Nodes/ComfyUI-ppm/Guidance Limiter
ComfyUI Node

Guidance Limiter

Apply CFG only in the interval where it helps

By pamparamm·Created 2 years ago·Updated a day ago· 265
Guidance Limiter
  • model
  • MODEL
sigma_start5.42
sigma_end0.28

CFG doesn't earn its keep evenly across a render. At the very start (high noise) heavy guidance mostly blows out contrast, and at the very end (low noise) it mostly adds crunchy artifacts. The useful work happens in the middle. Guidance Limiter acts on exactly that: it runs your guidance only inside a noise window and effectively turns it off outside. Same CFG number, cleaner image, less oversaturation.

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.) - an actual paper with measured quality gains, not a folk hack. 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.

Here's the thing to understand about this node versus the pack's CFGLimiterGuider: they implement the same paper, but this one is a model patch. MODEL in, MODEL out. That means it drops in front of a plain KSampler and takes your CFG from the sampler as usual - no SamplerCustomAdvanced graph required. The guider version packages guidance into a GUIDER object for the advanced sampler; this version just patches your model and gets out of the way. If you're on a normal KSampler workflow, this is the one you want.

The inputs that matter

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

That's it, plus the model. The 5.42 / 0.28 defaults are the paper's recommended SDXL-class window and a sane starting point. Your CFG value stays where it always was, on the sampler.

Real community datapoint: one r/comfyui user doing careful XY sweeps for realistic SDXL generations landed on sigma_start ≈ 3.1 and sigma_end ≈ 0.17 as their sweet spot - tighter than the defaults, trading a bit of vibrance for better faces and hands. Not gospel, but a useful direction if you're tuning for photoreal.

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.

Common issues & troubleshooting

It seems to do nothing. Sigma values are model-specific. The 5.42 / 0.28 window is tuned for the SDXL noise schedule; a model with a different schedule (or a v-prediction model) spends its sampling steps in a different sigma range, so your window may be sitting entirely outside where sampling actually happens. If nothing changes, your interval is probably in the wrong place, not broken.

Distilled models. On anything running at CFG 1 (Flux, Z-Image Turbo, distilled checkpoints) there's no real guidance to limit - the mechanism this node gates is barely running. It's built for the SD 1.5 / SDXL regime where you're actually pushing CFG.

Overcooked renders are the use case. If your SDXL output looks fried at CFG 7–8, try this at the same CFG before you start lowering it. Dropping CFG everywhere loses adherence along with the burn; the interval trick keeps adherence where it matters.

Pack rule: erroring after an update? Delete and re-add the node.

Categorymodel_patches/unet

Inputs (3)

NameTypeDefaultDescription
modelMODEL
sigma_startFLOAT5.42-1–10000
sigma_endFLOAT0.28-1–10000

Outputs (1)

NameTypeDescription
MODELMODEL