CFG (Classifier-Free Guidance) — Definition, How It Works & Best Scale
CFG (Classifier-Free Guidance) is the setting that controls how strictly an AI image model obeys your prompt. On each denoising step the model makes two predictions — one guided by your text, one ignoring it — and the CFG scale decides how far to push the result toward the guided one. Low values give looser, more creative images; high values follow the prompt harder but can look over-saturated.
What does CFG stand for?
CFG stands for Classifier-Free Guidance. It is a technique that steers a /glossary/diffusion model toward your /glossary/prompt without needing a separate image classifier. The method was introduced by Jonathan Ho and Tim Salimans in the 2022 paper "Classifier-Free Diffusion Guidance". In a tool like /alternatives/stable-diffusion you meet it as the "CFG scale" or "guidance scale" slider — a single number, usually between 1 and 15, that trades prompt adherence against natural-looking variety. It does not change what the model knows; it changes how hard the model is pushed to honour your words.
How classifier-free guidance works
During training the model learns to denoise in two modes: conditioned on the prompt and unconditioned (the prompt dropped out). At generation time it runs both on every step, producing a "with prompt" prediction and a "without prompt" one. CFG then extrapolates: it takes the unconditioned prediction and pushes it in the direction of the conditioned one, multiplied by the guidance scale. A scale of 1 means no guidance — just the raw conditioned output; higher scales exaggerate the difference, forcing the image to commit harder to the prompt. Because it reuses the same model twice instead of training a classifier, it is simpler and higher-quality than the older classifier guidance it replaced.
See the original 2022 paper at arxiv.org/abs/2207.12598 for the full derivation.

What is the best CFG scale?
There is no universal number — it depends on the model and how fast it samples. These are the ranges you will actually use:
- Standard models (Stable Diffusion, SDXL): 7–12 is the sweet spot; around 7 balances creativity and accuracy.
- Too low (1–5): the model loosely follows the prompt and can produce washed-out or structurally weak images.
- Too high (12+): images become over-saturated, over-contrasted and start to show artifacts.
- Distilled / turbo models (SDXL Turbo, LCM): use a very low CFG of 1–2, because guidance is baked in during distillation.
- Newer models like FLUX use guidance distillation, so their "guidance" number behaves differently from classic CFG — trust the model default.
How CFG interacts with the sampler, steps and seed
CFG is one of several linked controls and is easiest to understand by holding the others fixed. The /glossary/sampler and its step count decide how the denoising path is solved; CFG decides how strongly the prompt bends that path, and the two are independent, so a high-order sampler still needs a sensible CFG. The /glossary/prompt itself matters too: a long, specific prompt often needs less guidance than a short, vague one. To feel the effect, keep the seed, prompt, sampler and steps constant and change only the CFG scale — you will watch the image go from loose to literal to burnt. A negative prompt works alongside CFG by shaping the unconditioned side of the equation.
How Twin AI handles CFG
Twin AI is built so you never touch a CFG slider. When you generate in /create/photo or /use-cases/image-generator, Twin picks a well-tuned guidance value for each model behind the scenes, so your prompt is followed closely without the burnt, over-saturated look that comes from cranking CFG too high. Its /photoshoots templates are tuned end to end, and because Twin runs several image models you can compare their output — for example in /compare/midjourney-vs-flux — without learning each one's guidance quirks. Your personal /glossary/lora-style model plugs into the same pipeline. Everything is payable with a Russian card or SBP, with no VPN required. Start free in /create/photo.
FAQ
What does CFG mean in Stable Diffusion?
CFG stands for Classifier-Free Guidance. The CFG scale is a slider that controls how strictly the image follows your prompt: low values are looser and more creative, high values stick to the prompt but can look over-saturated. A value of 7 is a common balanced default.
What is the best CFG scale to use?
For standard Stable Diffusion and SDXL, 7–12 works well, with around 7 balancing creativity and prompt accuracy. Distilled or turbo models such as SDXL Turbo and LCM need a much lower CFG of 1–2, because guidance is built in during distillation.
What happens if CFG is too high?
Very high CFG (roughly 12 and above) over-emphasises the prompt: images become over-saturated, over-contrasted and can develop artifacts or a "fried" look. Lowering the scale usually restores natural colour and detail.
What is the difference between CFG and the sampler?
The sampler is the algorithm that solves the denoising steps, while CFG controls how strongly your prompt pulls that process. They are independent settings — you choose a sampler and step count separately from the CFG scale.
Do I need to set CFG in Twin AI?
No. Twin AI selects a tuned guidance value for each model automatically, so a plain description is enough — you get close prompt adherence without over-saturation. Just type a prompt or upload photos in /create/photo.