-
Notifications
You must be signed in to change notification settings - Fork 45
Textual Inversion
Textual Inversion allows you to train a tiny part of the neural network on your own pictures, and use results when generating new ones.
The result of training is a .pt or a .bin file (former is the format used by original author, latter is by the diffusers library).
See original site for more details about what textual inversion is: https://textual-inversion.github.io/.
Put the embedding into the embeddings
directory and use its filename in the prompt. You don't have to restart the program for this to work.
As an example, here is an embedding of Usada Pekora I trained on WD1.2 model, on 53 pictures (119 augmented) for 19500 steps, with 8 vectors per token setting.
Pictures it generates:
portrait of usada pekora
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 4077357776, Size: 512x512, Model hash: 45dee52b
You can combine multiple embeddings in one prompt:
portrait of usada pekora, mignon
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 4077357776, Size: 512x512, Model hash: 45dee52b
Be very careful about which model you are using with your embeddings: they work well with the model you used during training, and not so well on different models. For example, here is the above embedding and vanilla 1.4 stable diffusion model:
portrait of usada pekora
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 4077357776, Size: 512x512, Model hash: 7460a6fa
I successfully trained embeddings using those repositories:
Other options are to train on colabs and/or using diffusers library, which I know nothing about.
- huggingface concepts library - a lot of different embeddings, but mostly useless.
- 16777216c - NSFW, anime artist styles by a mysterious stranger.
- cattoroboto - some anime embeddings by anon.
- viper1 - NSFW, furry girls.
- anon's embeddings - NSFW, anime artists.
- rentry - a page with links to embeddings from many sources.
This is the Stable Diffusion web UI wiki. Wiki Home