home/ atoms/ comfyui-cfg-scale

CFG scale in ComfyUI's KSampler balances prompt adherence against image quality

The cfg (Classifier-Free Guidance) input to KSampler controls how strongly the denoiser follows the positive conditioning versus generating freely. High values (>12) produce images that match the prompt closely but can over-saturate colors or create artifacts. Low values (2–5) produce more naturalistic images with less prompt adherence. The value 8.0 is the ComfyUI default. CFG works by computing noise predictions for both positive and negative conditioning and extrapolating: output = negative + cfg * (positive - negative). A misconception is that higher CFG always improves quality — above roughly 12–15 it introduces artifacts and oversaturation.

Examples

cfg=1.0 → ignores prompt; cfg=8.0 → strong adherence; cfg=15.0+ → artifacts and blown-out colors.

Assessment

Given cfg=7.5, explain what raising it to 15 does to the denoising trajectory. At what extreme does the guidance become counterproductive?

“Classifier-Free Guidance scale balances creativity and adherence to the prompt. Higher values result in images more closely matching the prompt however too high values will negativ”
corpus · comfyui-modular-node-graph-engine-for-diffusion-pipelines · chunk 475