Zubnet AIAprenderWiki › Guidance Scale
Using AI

Guidance Scale

CFG Scale, Classifier-Free Guidance
Un parámetro que controla qué tan fuertemente un modelo de generación de imágenes sigue el prompt textual. Guidance baja (1–3): el modelo genera libremente, produciendo imágenes diversas pero potencialmente fuera de tema. Guidance alta (7–15): el modelo sigue el prompt estrictamente pero puede producir imágenes saturadas, llenas de artefactos. El sweet spot típico es 7–9. Es el equivalente de temperature para imágenes.

Por qué importa

Guidance scale es el parámetro de mayor impacto en generación de imágenes después del prompt mismo. Muy bajo y la imagen ignora tu descripción. Muy alto y se ve sobresaturada y artificial. Entender guidance scale te ayuda a diagnosticar «¿por qué mi imagen no coincide con mi prompt?» (guidance muy baja) y «¿por qué mi imagen se ve rara?» (guidance muy alta).

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

Avanzado 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.

Conceptos relacionados

← Todos los términos
ESC