What is CFG Scale?
Classifier-Free Guidance is a trick that lets a single diffusion model produce both unconditional (ignoring the prompt) and conditional (following the prompt) predictions during each denoising step. At inference, the model extrapolates away from the unconditional prediction toward the conditional one, with the CFG scale controlling how far.
Think of it as a 'prompt strength dial'. Zero means the prompt is ignored entirely. Values around 7 hit the sweet spot between creativity and adherence for most Stable Diffusion variants. Newer models (FLUX, SD 3.5) use different sensitivities — FLUX sweet spot is around 3.5.
How it works
Dual prediction
At each denoising step, the model predicts noise twice: once with the prompt and once without (using an empty prompt). The final prediction extrapolates along the vector from unconditional to conditional.
Extrapolation factor
CFG scale is the extrapolation factor. CFG=1 means no extrapolation (just conditional). CFG=7 means take 7× the distance from unconditional to conditional. High CFG amplifies prompt-following but also amplifies artifacts.
Common use cases
- Low CFG (1–4): Dreamy, artistic, abstract outputs — prompt is a loose starting point
- Medium CFG (5–9): Balanced — default for most Stable Diffusion workflows
- High CFG (10–15): Literal prompt adherence — used for text rendering or specific compositions
- Very high CFG (15+): Usually unstable — over-saturated colors, image artifacts