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.

Level: intermediateTopic: Generative media multimodal

Classifier-free guidance: an example

output = uncond + w * (cond - uncond) with w = 7.5 is a typical setting in Stable Diffusion pipelines.

Related terms

More Generative media multimodal terms

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.