-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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.
Is 528a183 still necessary? |
tildebyte
reviewed
Oct 17, 2022
Are there any issues you'd like to see resolved before I merge this? |
I'm going to go ahead and merge before too many new conflicts arise. |
The preload script is just loading each of the models in turn and then
discarding them. This seems senseless until you realize that these are
Hugging Face models that are loaded on demand via URL. If you are behind a
firewall, like me, then Invoke will fail whenever it tries to load one of
these models. So we use the preload script that downloads the models as a
side effect and caches them in local directories.
Lincoln
…On Tue, Oct 18, 2022 at 1:12 PM tildebyte ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In scripts/preload_models.py
<#1133 (comment)>:
>
transformers.logging.set_verbosity_error()
# this will preload the Bert tokenizer fles
-print('preloading bert tokenizer...', end='')
-
-tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')
+print('Loading bert tokenizer (ignore deprecation errors)...', end='')
+with warnings.catch_warnings():
+ warnings.filterwarnings('ignore', category=DeprecationWarning)
+ tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')
Right, but the BERT version of the tokenizer is permanently overwritten
by the CLIP version, so *nothing* is "using" it currently.
Relevant snippet (note that there's no conditional, nor is BERT "handed
off" to another alias of some kind):
# this will preload the Bert tokenizer flesprint('preloading bert tokenizer...', end='')
tokenizer = BertTokenizerFast.from_pretrained('bert-base-uncased')print('...success')
...*snip 7 irrelevant lines*
...
print('preloading CLIP model...',end='')sys.stdout.flush()
tokenizer = CLIPTokenizer.from_pretrained(version)
—
Reply to this email directly, view it on GitHub
<#1133 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA3EVIY4DHESH37MR4UO23WD3K7HANCNFSM6AAAAAARGU4YUI>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
This is an amazing new feature. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
add clipseg support for creating inpaint masks from text
On the command line, the new option is --text_mask or -tm.
Example:
This will find the orange fruit in the still life painting and replace it with an image of a baseball.