The CFG Scale (Classifier-Free Guidance Scale) is the primary numerical hyperparameter controlling how strictly a diffusion model adheres to your text prompt versus exploring unconditional creative entropy.
Every generative image and video creator encounters this slider. Dialing it too low produces hazy, unresponsive generations that ignore crucial keywords; cranking it too high results in the notorious “deep-fried” artifact — extreme contrast, garish oversaturation, and harsh geometric halos.
Why it works
The mechanism of CFG scale is governed by the foundational Classifier-Free Guidance formulation established by Jonathan Ho and Tim Salimans:
Where is the unconditional noise prediction (using an empty null token), is the text-conditioned prediction, and is the CFG scale scalar multiplier:
- At (Zero Guidance Boost): The model samples directly from standard conditional probability. Prompt following is loose, and the model relies heavily on the stochastic biases of its training weights.
- At (The Production Sweet Spot): The difference vector is amplified cleanly. The latent trajectory steers decisively toward the intended semantic mode without exceeding the standard deviation boundaries of the VAE latent distribution. Skin tones remain organic and lighting stays balanced.
- At (Latent Overdrive & Saturation): The difference vector is magnified so aggressively that latent tensor values exceed the valid dynamic range expected by the VAE decoder. When converted back into RGB pixel space, high values are brutally clamped at maximum luminance, manifesting as blown highlights, neon color casts, and fried textures.
When paired with a structured negative-prompt, the unconditional baseline is replaced by the negative conditioning vector , allowing the scale parameter to simultaneously push away from defects while pulling toward positive prompt attributes.
When to use it
- Dialing into the sweet spot (
5.0–7.0): Standard baseline for photorealistic cinematic generation across Stable Diffusion, Flux, and Kling AI. - Complex multi-clause prompt enforcement (
7.5–9.0): Forcing adherence when specifying intricate blocking, specific wardrobe, and lighting angles from prompt-structure. - Loosening constraints for abstract concepts (
3.0–4.0): Encouraging organic randomness in fantasy landscapes, cloud formations, or surreal dreamscapes. - Taming stylized LoRAs (
3.5–5.0): Lowering CFG scale prevents external LoRAs from burning into the base model weights.
Pitfalls
- The “crank it to 12” trap: Believing that higher numbers yield “better quality.” High CFG values do not increase fidelity; they merely amplify contrast and destroy subtle gradients. Keep generations within
4.5–7.5. - Compounding high CFG with negative prompt dumps: Stacking a
10.0CFG scale with a 50-word negative prompt dump triggers extreme vector repulsion, causing distorted anatomy and plastic faces. Use minimal, targeted negative tokens as taught in negative-prompt. - Overlooking model architectural differences: Flux.1 and SD3 use flow-matching architectures with Guidance Distillation, often preferring a much lower CFG scale (
2.5–3.5), whereas SD 1.5/SDXL thrives around7.0. Check model specifications. - Color banding post-processing: High CFG values collapse subtle color transitions into ugly 8-bit stepped bands. If grading footage downstream in a color-grading-pass, shoot with moderate CFG to preserve maximal 10-bit dynamic range.
Recommended Parameter Guidelines
| Engine / Architecture | Recommended CFG Range | Default Value | Notes |
|---|---|---|---|
| Stable Diffusion XL | 5.0 – 7.5 |
7.0 |
Pristine photorealism; above 8.5 risks skin over-sharpening |
| Flux.1 (Dev / Schnell) | 2.5 – 3.5 |
3.5 |
Distilled guidance; higher values quickly burn pixels |
| Kling AI / Runway Gen-3 | 4.0 – 6.5 |
5.0 |
Smooth temporal vectors; high CFG causes severe video jitter |
Model-specific prompts
Stable Diffusion XL (CFG 6.5)
Cinematic portrait of an architect in a concrete studio, natural diffuse morning light, 85mm lens f/2.8, realistic skin pores, photorealistic, 4k --cfg 6.5 --steps 30.
Kling AI (Relevance / CFG 0.5 – equivalent to 5.0)
A lone detective walks through a foggy alley, high temporal consistency, naturalistic color saturation, 35mm film grain, prompt weight balanced at 0.5, no blown highlights.
Flux.1 Dev (Guidance 3.0)
Masterpiece photograph, elegant woman in a tailored wool coat standing in a European courtyard, soft overcast sky, hyper-realistic, muted natural palette --guidance 3.0.
Related
CFG scale directly governs the intensity of repulsion in your negative-prompt and controls the syntactic parsing of your prompt-structure. When generating assets intended for a multi-shot color-grading-pass, moderate CFG scales preserve the dynamic range necessary for high-end color grading.