Zubnet AIApprendreWiki › Guidance Scale
Using AI

Guidance Scale

CFG Scale, Classifier-Free Guidance
Un paramètre qui contrôle à quel point un modèle de génération d'images suit le prompt textuel. Guidance basse (1–3) : le modèle génère librement, produisant des images diverses mais potentiellement hors sujet. Guidance haute (7–15) : le modèle suit strictement le prompt mais peut produire des images saturées, pleines d'artefacts. Le sweet spot typique est 7–9. C'est l'équivalent génération d'images de la temperature pour les modèles de texte.

Pourquoi c'est important

La guidance scale est le paramètre le plus impactant en génération d'images après le prompt lui-même. Trop bas et l'image ignore ta description. Trop haut et elle a l'air sursaturée et artificielle. Comprendre la guidance scale t'aide à diagnostiquer « pourquoi mon image ne matche pas mon prompt ? » (guidance trop basse) et « pourquoi mon image a l'air bizarre ? » (guidance trop haute).

Deep Dive

Classifier-free guidance (Ho & Salimans, 2022) works by computing two denoising predictions per step: one conditional (using your prompt) and one unconditional (ignoring the prompt). The final prediction amplifies the difference: output = unconditional + scale × (conditional − unconditional). Scale=1 means no guidance (just the conditional prediction). Scale=7 means the model amplifies the prompt's influence 7x beyond what it would naturally do.

Why Higher Isn't Always Better

Higher guidance makes the image more "prompt-aligned" but at a cost: the model overshoots, producing oversaturated colors, unrealistic lighting, and visual artifacts. Very high guidance (15+) often produces images that look like they've been run through a sharpening filter — technically matching the prompt but aesthetically poor. The sweet spot depends on the model: SD 1.5 works well at 7–9, SDXL at 5–8, and Flux at 3–5.

Dynamic and Negative CFG

Avancé techniques manipulate guidance during generation: starting with high guidance (to establish composition) and reducing it in later steps (to refine details naturally). Negative CFG (guidance scale below 1) inverts the prompt's effect, generating the opposite of what's described — useful for understanding what the model associates with specific concepts but rarely useful for actual image generation.

Concepts liés

← Tous les termes
ESC