AI engineering glossary · Generative media multimodal
What is CFG (classifier-free guidance)?
Classifier-free guidance (also called CFG): A technique that makes diffusion models follow a text prompt more closely. The model is trained sometimes with and sometimes without the condition, and at sampling time the prediction is pushed away from the unconditional output toward the conditional one. It trades diversity for prompt adherence.
Classifier-free guidance: an example
output = uncond + w * (cond - uncond) with w = 7.5 is a typical setting in Stable Diffusion pipelines.
Related terms
- Guidance scale
- Classifier guidance
- Text-to-image generation
More Generative media multimodal terms
- CLIP score
- Codebook
- Conditional GAN
- Consistency model
- Content provenance
- ControlNet
- Cross-attention conditioning
- Cross-modal retrieval
Where you learn it
Classifier-free guidance is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.