What Is the Text Encoder? CLIP, T5 and LLM Encoders Explained
Your words never reach the image model directly. A text encoder turns the prompt into embeddings, which the diffusion model uses as guidance. The encoder largely decides how well a model understands prompts.
Generations of text encoders
- CLIP (SD 1.5, SDXL): trained to match images and short captions. Works best with concise phrases and tags. 77-token context per chunk.
- T5-XXL (FLUX.1, SD3, Chroma): a large language model encoder that understands sentences and longer prompts.
- Large language and vision-language models (Qwen-Image, FLUX.2 and others): even stronger grammar, layout and text understanding.
CLIP skip
Some anime models were trained using the second-to-last CLIP layer. Setting “CLIP skip 2” matches that. Use it only when the model card says so.
Memory
Modern text encoders are large; T5-XXL alone is several gigabytes. UIs usually load them, encode the prompt, then offload them to system RAM. FP8 or GGUF versions save memory. See FP8.
Embeddings
Textual inversion works by adding new learned tokens to the text encoder’s vocabulary.
Practical prompting differences in FLUX vs SDXL.
Related
More terms: ControlNet · Denoising strength · Hires fix · IP-Adapter · Sampler · Scheduler · Full glossary