Limited Interval CFG Guider ๐
Only pay for guidance during the steps that actually need it
- model
- positive
- negative
- GUIDER
CFG runs your prompt through the model twice every step - once conditioned, once unconditioned - and blends the two. That's real, doubled compute at every single step for the whole run, whether or not guidance is actually doing useful work at that point in the trajectory. This guider's whole idea is to stop paying that cost everywhere: apply real CFG only inside a window of steps you choose, and skip the unconditioned pass outside it.
Why limiting the window makes sense
Early steps in a diffusion run are mostly deciding rough composition; late steps are mostly refining detail. Guidance matters most somewhere in the middle, where the prompt still has real influence to exert over what's forming - and running full-strength CFG all the way through is also exactly what produces the oversaturated, "burned" look you get from CFG set too high with too few steps, since the correction keeps compounding all the way to the end. A guider that only applies CFG inside a defined interval is a way to get the steering you actually need in the window where it counts, while skipping the compute (and the burn risk) everywhere else.
This is the same design space as ComfyUI's CFG-1 optimization, where cond_scale exactly 1.0 skips computing the unconditioned pass entirely because the math cancels it out - this guider generalizes that idea into an explicit window rather than an all-or-nothing switch.
Inputs and outputs
Required:
- model - your checkpoint's MODEL.
- positive / negative - CONDITIONING, same as any CFG-based guider.
- cfg - the guidance strength used inside the active window, default 8, up to 100.
- start_step / end_step - where the CFG window begins and ends, expressed as a 0-1 fraction of the total sampling trajectory rather than absolute step counts. Defaults are 0 and 1 - the full range, meaning CFG applies everywhere unless you narrow it.
Output is a single GUIDER, wired into SamplerCustomAdvanced in place of the stock CFGGuider.
Installing it
ComfyUI Manager, search "cgem156-ComfyUI". Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/laksjdjf/cgem156-ComfyUI
Restart ComfyUI afterward. No model download involved - it's a guidance algorithm, works with whatever checkpoint you already have loaded.
Where to actually set the window
Since start_step/end_step are fractions of the whole run rather than fixed step counts, they carry over sensibly even if you change your total step count later - a 0.2-0.7 window still means "the middle 50% of the trajectory" whether you're running 20 steps or 40. A common pattern worth trying: end the window well before 1.0 (say, 0.6-0.7) to let the model's own detail-refinement dominate the final steps unguided, which is close in spirit to running a second unguided pass the way some community Z-Image workflows do it manually with two chained KSamplers.
Common issues
If narrowing the window doesn't seem to change your output much, remember that outside the active range this guider is effectively running at CFG 1 (guidance off) rather than at some reduced strength - so the effect of narrowing the window is more like "shorten how long guidance gets applied" than "gradually taper it," and abrupt CFG changes at the window boundary can occasionally show up as a subtle seam if the window edges land in an unlucky spot. If you're chasing the too-high-CFG burned look and narrowing the window doesn't fix it, the cfg value itself is still the primary lever - check that before assuming the interval is misconfigured.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | โ | |
| positive | CONDITIONING | โ | |
| negative | CONDITIONING | โ | |
| cfg | FLOAT | 8.00โ100 | โ |
| start_step | FLOAT | 0.0000โ1 | โ |
| end_step | FLOAT | 1.0000โ1 | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| GUIDER | GUIDER | โ |