Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: Segment Anything #5829

Open
wants to merge 6 commits into
base: next
Choose a base branch
from

Conversation

blessedcoolant
Copy link
Collaborator

@blessedcoolant blessedcoolant commented Feb 29, 2024

What type of PR is this? (check all applicable)

  • Feature

Have you discussed this change with the InvokeAI team?

  • Yes

Have you updated all relevant documentation?

  • No

Description

This PR is the first draft of implementing a full fledged automated mask creation system inside InvokeAI. The first piece of that puzzle is the Segment Anything node.

DONE

Segment Anything Image Processor

  • image: A PIL Image
  • model_type: 3 different model types are available - small, medium, large, small_hq, medium_hq, large_hq, and mobile. These models are automatically downloaded on first boot.
  • x_coordinate: The x co-ordinate of your selected point.
  • y_coordinate: The y-coordinate of your selected point.
  • background: If your selected point is in the background or not.

Note: In the Linear UI, we will need to create a UI which allows us to select a point in the image.

opera_cIZFUJ3maK

Workflow Example

opera_NjiymzsNkP.mp4

@blessedcoolant blessedcoolant changed the base branch from main to next February 29, 2024 11:06
@github-actions github-actions bot added python PRs that change python files invocations PRs that change invocations backend PRs that change backend files labels Feb 29, 2024
@lstein
Copy link
Collaborator

lstein commented Feb 29, 2024

Very exciting! I’ll review this evening.

@blessedcoolant
Copy link
Collaborator Author

Very exciting! I’ll review this evening.

I'll need your help on this too. Currently the models load each time. I can bypass that setting global vars and conditonal checks. Which I'll do now. But at some point, I'll need you to fit the model and predictor into the model manager and have the memory management be done there.

@blessedcoolant
Copy link
Collaborator Author

Added support for SamHQ and Mobile models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend PRs that change backend files invocations PRs that change invocations python PRs that change python files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants