-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Finish docs textual inversion #3068
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
Conversation
The documentation is not available anymore as the PR was closed or merged. |
The textual inversion script will by default only save the textual inversion embedding vector(s) that have | ||
been added to the text encoder embedding matrix and consequently been trained. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also provide the example?
Currently there is no `load_textual_inversion` function for Flax so one has to make sure the textual inversion | ||
embedding vector is saved as part of the model after training. | ||
|
||
The model can then be run just like any other Flax model: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sentence closes with :
. Did you mean to provide any example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok, there's a python snippet after the paragraph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 🏆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool!
|
||
To load the textual inversion embeddings you first need to load the base model that was used when training | ||
your textual inversion embedding vectors. Here we assume that [`runwayml/stable-diffusion-v1-5`](runwayml/stable-diffusion-v1-5) | ||
was used as a base model so we load it first: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked if it was possible to retrieve the model from the trained concepts, but it looks like not all the models have a base_model
metadata tag in the readme file :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I noticed this too, but changed the notebook so that future models have it :-) Sadly we don't really know what previous text inversions were trained on (I'd assume that most were trained on compvis1-4 though: huggingface/notebooks@944dc4b) cc @apolinario
Currently there is no `load_textual_inversion` function for Flax so one has to make sure the textual inversion | ||
embedding vector is saved as part of the model after training. | ||
|
||
The model can then be run just like any other Flax model: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok, there's a python snippet after the paragraph.
Co-authored-by: Sayak Paul <[email protected]> Co-authored-by: Pedro Cuenca <[email protected]>
* Finish docs textual inversion * Apply suggestions from code review Co-authored-by: Sayak Paul <[email protected]> Co-authored-by: Pedro Cuenca <[email protected]> --------- Co-authored-by: Sayak Paul <[email protected]> Co-authored-by: Pedro Cuenca <[email protected]>
* Finish docs textual inversion * Apply suggestions from code review Co-authored-by: Sayak Paul <[email protected]> Co-authored-by: Pedro Cuenca <[email protected]> --------- Co-authored-by: Sayak Paul <[email protected]> Co-authored-by: Pedro Cuenca <[email protected]>
* Finish docs textual inversion * Apply suggestions from code review Co-authored-by: Sayak Paul <[email protected]> Co-authored-by: Pedro Cuenca <[email protected]> --------- Co-authored-by: Sayak Paul <[email protected]> Co-authored-by: Pedro Cuenca <[email protected]>
* Finish docs textual inversion * Apply suggestions from code review Co-authored-by: Sayak Paul <[email protected]> Co-authored-by: Pedro Cuenca <[email protected]> --------- Co-authored-by: Sayak Paul <[email protected]> Co-authored-by: Pedro Cuenca <[email protected]>
No description provided.