Files
ComfyUI-CFG-CTRL/nodes.py
Ethanfel 2c50da025d Fix correction accumulation: store raw guidance in prev_eps
The paper stores corrected guidance, but in ComfyUI the corrections
compound through the sliding surface's lambda * prev_eps term
(amplified 4x per step at lambda=5). Over 20 steps this overwhelms
the actual guidance signal, causing total corruption at full K.

Storing raw (pre-correction) guidance keeps the surface tracking
the model's actual guidance evolution while applying fresh
corrections each step. This allows using full K=0.2 (matching
the paper) without accumulation-driven instability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 18:59:39 +01:00

5.4 KiB