CFGLimiterGuider
Apply CFG only where it helps
- model
- positive
- negative
- GUIDER
Here's a finding that's held up: CFG doesn't help equally at every step. At the very start of sampling (high noise) cranking guidance mostly blows out your contrast, and at the very end (low noise) it mostly adds artifacts. The useful guidance happens in the middle. CFGLimiterGuider acts on that - it applies your CFG scale only within a chosen noise interval and effectively runs guidance-off outside it. Cleaner images, less oversaturation, same prompt.
The idea, grounded
This is a ComfyUI implementation of "Applying Guidance in a Limited Interval Improves Sample and Distribution Quality in Diffusion Models" (Kynkäänniemi et al.) - not a folk hack, an actual paper with measured quality gains. The mechanism: instead of holding CFG constant across the whole denoising run, it limits guidance to a window defined by sigma (the noise level). Above sigma_start and below sigma_end, guidance is essentially disabled; inside, your full CFG applies. That's it. Because it targets guidance at the steps where it earns its keep, you get the prompt adherence without the blown highlights that high CFG normally drags along.
The node is a guider, which is the newer ComfyUI sampling pattern: it packages the model plus your positive/negative conditioning plus the guidance rule into one GUIDER object that you feed to SamplerCustomAdvanced (alongside your sampler and sigmas). It replaces the BasicGuider/CFGGuider you'd normally use there.
The inputs
- model (MODEL), positive (CONDITIONING), negative (CONDITIONING) - the usual trio, wired in here rather than at a KSampler.
- cfg (default 8) - your guidance scale, applied inside the interval. Same meaning as always.
- sigma_start (default 5.42) - the high-noise edge. Above this sigma, guidance is off.
- sigma_end (default 0.28) - the low-noise edge. Below this sigma, guidance is off.
The defaults (5.42 / 0.28) are the paper's recommended window for SDXL-class models and a sensible starting point. Output is a GUIDER → into SamplerCustomAdvanced.
Install
No models, no deps:
- ComfyUI Manager: search "ComfyUI-ppm", install, restart.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/pamparamm/ComfyUI-ppm, then restart.
Honest take and gotchas
This is one of the more legitimately useful nodes in the pack if you're an SDXL user fighting oversaturation. The failure mode of "just lower CFG everywhere" is that you lose prompt adherence along with the blowout; the interval trick keeps adherence where it matters and drops guidance where it only hurts. If your renders look overcooked at CFG 7-8, try this at the same CFG before you start lowering it.
The catch is that sigma values are model-specific. Those 5.42 / 0.28 defaults are tuned for the SDXL noise schedule; a model with a different schedule (or a v-prediction model) has different sigma ranges, so the window may need adjusting. If it seems to do nothing, your interval is probably sitting outside where your model's sampling actually spends its steps. There's a related ConvertTimestepToSigma node in this same pack precisely for turning a human-friendly timestep into the sigma number this window wants - handy when you're porting the interval to a different model.
Also note: the README mentions the same Guidance Limiter is available as a post-CFG function if you'd rather keep your existing guider and layer this on. The guider node here is the all-in-one version for SamplerCustomAdvanced.
Pack rule: erroring after an update? Delete and re-add. And it only works in the SamplerCustomAdvanced graph - it won't plug into a plain KSampler.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| cfg | FLOAT | 8.00–100 | — |
| sigma_start | FLOAT | 5.42-1–10000 | — |
| sigma_end | FLOAT | 0.28-1–10000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| GUIDER | GUIDER | — |