AI Glossary · parameter

What is CFG Scale?

Definition
CFG Scale (Classifier-Free Guidance) is a diffusion-model parameter that controls how strictly generation follows your text prompt. Low values (1–3) produce creative, loosely-prompted outputs. High values (10–20) produce literal, prompt-adherent outputs — but can over-saturate colors and create artifacts. Most users settle in the 5–9 range.

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

Frequently asked questions

What's the default CFG scale on Oakgen?
7.5 for Stable Diffusion 1.5/XL, 5 for SD 3.5, 3.5 for FLUX Pro. These are model-specific sweet spots established through community testing and our internal benchmarks.
Does higher CFG always mean better results?
No. Above ~10, images start to over-saturate and develop artifacts. High CFG is useful for very precise compositions (text in images, exact object placement) but sacrifices overall image quality.

Further reading

Related terms

What is CFG Scale? Prompt Adherence Parameter Explained | Oakgen | Oakgen.ai