-
Notifications
You must be signed in to change notification settings - Fork 22
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 initial support for Textual Inversion models #179
Comments
#199 adds support for the |
#209 adds support for many of the inversions on Civitai. The main difference is the shape of the tensor data, with some having an additional axis:
vs
Looping over that first axis and generating a token for each layer works, and allows them to be controlled/weighted separately as well. I came across https://www.reddit.com/r/StableDiffusion/comments/zl81na/how_to_use_embeddings_with_pytorch/, and they were kind enough to point out https://github.com/kohya-ss/sd-scripts/blob/main/gen_img_diffusers.py#L2174, which does pretty much the same thing. This still needs to be documented in the user guide, and may need some token replacement logic, but it definitely works. |
The best solution for this is probably a single token that automatically expands into the correct number, #179, but that will require something like Until then, I've implemented infinite-length prompts with a range expansion syntax: With docs, too: |
https://huggingface.co/docs/diffusers/training/text_inversion
The text was updated successfully, but these errors were encountered: