What Is Textual Inversion (Embeddings) in Stable Diffusion?
Textual inversion teaches the text encoder a new word. Instead of changing the image model, it learns an embedding vector that represents a concept, then you trigger it with a keyword in your prompt.
Uses
- Styles and objects in a tiny file.
- Negative embeddings: bundles of unwanted traits used in the negative prompt to improve quality, popular in the SD 1.5 and SDXL eras.
Compared with LoRA
| Textual inversion | LoRA | |
|---|---|---|
| What it changes | Text embeddings | Model weights (small adapters) |
| File size | Kilobytes | Megabytes |
| Expressive power | Limited | Much stronger |
For characters and strong styles, LoRAs are usually better. See the LoRA training guide.
Compatibility
Embeddings are tied to a specific text encoder: SD 1.5 embeddings do not work with SDXL, and models with T5 or LLM encoders rarely use them.
Using one
Place the file in the embeddings folder and type its trigger word in the prompt or negative prompt. Learn about encoders in text encoder.
Related
More terms: ControlNet · Denoising strength · FP8 · Hires fix · Latent space · Sampler · Full glossary