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

Add text prompt to inpaint mask support #1133

Merged
merged 4 commits into from
Oct 18, 2022
Merged

Add text prompt to inpaint mask support #1133

merged 4 commits into from
Oct 18, 2022

Conversation

lstein
Copy link
Collaborator

@lstein lstein commented Oct 17, 2022

add clipseg support for creating inpaint masks from text

On the command line, the new option is --text_mask or -tm.
Example:

invoke> a baseball -I /path/to/still_life.png -tm orange

This will find the orange fruit in the still life painting and replace it with an image of a baseball.

still-life-scaled
still-life-inpainted

…on level

- In CLI: the argument is --png_compression <0..9> (-z<0..9>)
- In API, pass `compress_level` to PngWriter.save_image_and_prompt_to_png()

Compression ranges from 0 (no compression) to 9 (maximum compression).
Default value is 6 (as specified by Pillow package).

This addresses an issue first raised in #652.
On the command line, the new option is --text_mask or -tm.
Example:

```
invoke> a baseball -I /path/to/still_life.png -tm orange
```

This will find the orange fruit in the still life painting and replace
it with an image of a baseball.
@tildebyte
Copy link
Contributor

Is 528a183 still necessary?

@lstein
Copy link
Collaborator Author

lstein commented Oct 18, 2022

Are there any issues you'd like to see resolved before I merge this?

@lstein
Copy link
Collaborator Author

lstein commented Oct 18, 2022

I'm going to go ahead and merge before too many new conflicts arise.

@lstein lstein merged commit 329a9d0 into development Oct 18, 2022
@lstein lstein deleted the text-masking branch October 18, 2022 12:30
@lstein
Copy link
Collaborator Author

lstein commented Oct 18, 2022 via email

@Any-Winter-4079
Copy link
Contributor

Any-Winter-4079 commented Oct 19, 2022

This is an amazing new feature.
Works surprisingly well with Textual Inversion embeddings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants