CFG scale (classifier-free guidance scale, also called guidance scale) is the setting in AI image tools that controls how strictly the picture follows your prompt. Turn it up and the image sticks closer to your words; turn it down and the model takes more liberties.
Think of giving directions to a taxi driver. A low setting is “head roughly north, take whatever route you like”: relaxed, sometimes scenic, sometimes lost. A high setting is barking every turn: you arrive where you said, but the ride gets jerky. CFG scale is how hard you lean on the driver.
In a sentence: “The model kept ignoring the red umbrella in my prompt, so I nudged the CFG scale up a little and it finally appeared.”
What does CFG scale mean?
The plain point: it is a prompt-obedience dial, with a cost at both ends.
Hugging Face, the site where many AI models are shared, explains it in its developer guide: a lower guidance scale gives the model room to make images more loosely related to the prompt, a higher one pushes it to follow the prompt more closely, and too high a value can cause visible flaws.1 Its reference pages put the trade-off plainly: closer to the prompt “at the expense of lower image quality.”2
How it works, simply
The plain point: the model makes two guesses at each step and leans towards the one that listened to you.
Diffusion models build an image in many small clean-up steps. With classifier-free guidance, the model is trained to make each step two ways: once using your prompt and once ignoring it. The guidance scale says how far to push past the “ignoring” guess towards the “listening” one. The bigger the push, the more the prompt dominates.3
This is also why a negative prompt sometimes does nothing. In Hugging Face’s Stable Diffusion software, the negative prompt is “Ignored when not using guidance”: switch guidance off and the list of things to leave out goes with it.2
Raise CFG scale when the picture ignores part of your prompt; lower it when results look harsh, overcooked or full of glitches. Change it in small steps.
What number should you use?
The plain point: it depends on the model, so start from the model’s own default.
There is no universal right value. Hugging Face’s Stable Diffusion software starts at 7.5.2 Newer fast models work differently. Hugging Face lists FLUX.1-dev as “guidance-distilled”, meaning the guidance is built into the model, and its example uses 3.5; for the speed-tuned FLUX.1-schnell it says the guidance scale “needs to be 0”.4 If your app shows no such setting, it is being chosen for you. Otherwise, check the model card or your app’s help page before copying a number from someone else’s settings.
Where the word comes from
The method was named by the researchers Jonathan Ho and Tim Salimans. Earlier “classifier guidance” needed a separate image classifier to steer the picture; their paper, posted to arXiv on 26 July 2022, showed the same steering works without one, hence “classifier-free”.3 The “scale” is simply the strength of that guidance.
Often confused with
| Word | How it differs |
|---|---|
| Strength (img2img) | Differs: sets how far the result may stray from a starting picture. CFG sets how closely it follows the words. See img2img meaning. |
| Temperature | Differs: a chatbot setting for how varied the wording is. CFG is about obeying the prompt, in image models. |
| Seed | Differs: fixes the random starting point. CFG changes how the image is steered from there. |
Questions people ask
Is CFG scale the same as guidance scale?
Yes, for most tools. Hugging Face’s software calls the setting guidance_scale, and its code switches classifier-free guidance on when that value is above 1.2 Distilled models such as FLUX.1-dev are the exception: their guidance number only imitates true CFG.
Why do my images look worse at a high CFG scale?
Because following the prompt harder costs image quality. Hugging Face warns of artifacts when the value is too high and describes the trade as closer prompt-matching “at the expense of lower image quality”.2 Lower it a step and rerun on the same seed to compare fairly.
Does every AI image tool have a CFG setting?
Not always. Some fast models need it set to zero, as Hugging Face says of FLUX.1-schnell, and where an app shows no such setting, the app chooses it for you.4
Learn more on this site
- All the dials: AI prompting terms glossary.
- Saying what to leave out: negative prompt meaning.
- The engine: diffusion model meaning.
- Starting from a picture: img2img meaning.
- The words: the AI glossary.
QUICK CHECK · 3 QUESTIONS
Pick an answer to see if you got it. Nothing is recorded.
1. What does the CFG scale control in an AI image tool?
- How strictly the picture follows your prompt
- How many pictures the tool makes at once
- The size of the finished image file
Show the answer
Answer: How strictly the picture follows your prompt. CFG scale is the prompt-obedience dial: higher sticks closer to your words, lower lets the model take more liberties.
2. What can happen if you turn the CFG scale up too high?
- The tool stops reading your prompt at all
- The picture always gets sharper and better
- The picture can look harsh or show visible flaws
Show the answer
Answer: The picture can look harsh or show visible flaws. Following the prompt harder lowers image quality, so too high a value can make results look harsh, overcooked or glitchy.
3. What number does the page suggest starting from?
- Always 7.5, whatever the model
- The model’s own default, from its model card or your app’s help
- The highest number the app allows
Show the answer
Answer: The model’s own default, from its model card or your app’s help. There is no universal right value, so the page says to start from the model’s own default rather than copying someone else’s number.
Related terms: AI upscaling · ControlNet · Diffusion model · Image-to-video · Text-to-speech (TTS) · Text-to-video
- 1Hugging Face, Text-to-image, Diffusers documentation, undated, read at source 12 Oct 2026“A lower value gives the model ‘creativity’ to generate images that are more loosely related to the prompt. Higher guidance_scale values push the model to follow the prompt more closely, and if this value is too high, you may observe some artifacts in the generated image.” ↑
- 2Hugging Face, Text-to-image (StableDiffusionPipeline), Diffusers API documentation, undated, read at source 12 Oct 2026“A higher guidance scale value encourages the model to generate images closely linked to the text prompt at the expense of lower image quality. Guidance scale is enabled when guidance_scale > 1.” ↑anegative_prompt “Ignored when not using guidance (guidance_scale < 1).” ↑b“guidance_scale (float, optional, defaults to 7.5)”. ↑c“Guidance scale is enabled when guidance_scale > 1.”; do_classifier_free_guidance: “whether to use classifier free guidance or not”. ↑d“at the expense of lower image quality”. ↑e
- 3Ho & Salimans, Classifier-Free Diffusion Guidance, arXiv:2207.12598, submitted 26 Jul 2022, read at source 12 Oct 2026“in what we call classifier-free guidance, we jointly train a conditional and an unconditional diffusion model, and we combine the resulting conditional and unconditional score estimates”. ↑a“We show that guidance can be indeed performed by a pure generative model without such a classifier”. ↑b
- 4Hugging Face, Flux, Diffusers API documentation, undated, read at source 12 Oct 2026FLUX.1-dev listed as “Guidance-distilled”, example call with guidance_scale=3.5; “Guidance-distilled models approximates true classifier-free guidance for guidance_scale > 1.”; for FLUX.1-schnell: “guidance_scale needs to be 0.” ↑a“guidance_scale needs to be 0.” ↑b
Hugging Face, Text-to-image, StableDiffusionPipeline and Flux, Diffusers documentation, undated, read at source 12 Oct 2026.
The comparisons and examples on this page (the taxi driver, the red umbrella) are this site’s own ways of explaining, not claims from these sources.
Free printable AI cheat sheets, and AI news every week.
Sixteen one-page AI guides and checklists in one free PDF, no sign-up. And if you want to keep up, the newsletter covers what changed in AI each week, in plain English, with the sources.
SUBSCRIBE FREE ↗ GET THE CHEAT SHEET PACK