Classifier-Free Guidance (CFG)
Classifier-Free Guidance controls how strongly a diffusion model follows the text prompt – higher values produce more prompt-faithful but potentially over-saturated images.
CFG scale controls prompt adherence in diffusion models – the most important parameter alongside sampling steps for balancing creativity and accuracy.
Explanation
CFG interpolates between conditioned and unconditioned denoising. CFG=1 essentially ignores the prompt. CFG=7-12 is typical for good balance. CFG>15 creates artifacts. Stable Diffusion, DALL-E, and Midjourney all use CFG.
Marketing Relevance
Core parameter for image quality: The right CFG scale is crucial for professional results in marketing image generation.
Example
For product images: CFG 7-9 delivers realistic, prompt-faithful results. For creative exploration: CFG 4-6 allows more variation.
Common Pitfalls
Too high CFG produces oversaturated, artificial images. CFG interacts with sampling steps and scheduler. Optimal value varies per model.
Origin & History
Ho & Salimans (2022) introduced Classifier-Free Guidance as an elegant alternative to Classifier Guidance. Instead of a separate classifier, CFG uses the model itself for conditioned and unconditioned predictions. The concept became standard in all modern diffusion models.
Comparisons & Differences
Classifier-Free Guidance (CFG) vs. Negative Prompt
CFG controls the strength of prompt following; negative prompts specify what to avoid.
Classifier-Free Guidance (CFG) vs. Temperature (LLM)
CFG for images: prompt adherence vs. variation. Temperature for text: token selection randomness. Similar concept, different medium.