Nodes/CFG Megapack/Guidance Interval (Kynkaanniemi et al. 2024)
ComfyUI Node

Guidance Interval (Kynkaanniemi et al. 2024)

Guide the middle of the run and skip the pass where you don't

By AbstractEyes·Created 5 days ago·Updated 5 days ago· 3
Guidance Interval (Kynkaanniemi et al. 2024)
  • model
  • MODEL
◄sigma_low0.28►
◄sigma_high5.42►

This is the one node in the pack that saves you render time. Guidance Interval (Kynkaanniemi, Aittala, Karras, Laine, Aila & Lehtinen, NeurIPS 2024) applies guidance only in a middle window of noise levels and switches to the conditional prediction alone outside it - which means the unconditional pass doesn't have to be computed at those steps at all. Cheaper and, per the paper, better-looking, because the noisiest steps are where guidance does the most damage.

How it works

The node stores a sigma window on the model's guidance plan, and at every step checks where the current noise level sits:

  • Inside sigma_low < sigma <= sigma_high: normal CFG at your sampler's cfg.
  • Outside: the conditional prediction alone, and the unconditional evaluation is skipped.

The pack gives no scale input here - the sampler's cfg is the scale inside the window, and there's nothing to scale outside it.

The bounds are in EDM sigma units. On SDXL and SD 1.5 that's the same sigma ComfyUI shows you, so the paper's numbers transfer directly. On a flow-matching model they wouldn't, so the pack converts them itself: your flow model gets the equivalent noise level sigma / (1 + sigma) instead. Don't hand-convert - that's the sort of thing the pack does correctly once and you'd do wrongly twice.

The inputs

Two, plus the model:

  • sigma_low - the lower bound, default 0.28. This is the sharp end of the run; below it, guidance is off and the conditional prediction finishes the image.
  • sigma_high - the upper bound, default 5.42. 1000 disables the ceiling entirely. Above it, the composition forms unguided.

Those defaults aren't invented: they're the paper's SD-XL settings, and the paper runs cfg all the way up to 16 inside that window. That's the pitch - turn the adherence up hard for the steps where guidance is well-behaved and let the steps where it isn't go free.

When to reach for it

Two use cases, and they're both about burning.

High cfg without burning. Cranking cfg to 12+ on SDXL normally blows out colour and contrast in the first few steps, because at high sigma the two estimates sit far apart and the extrapolation overshoots. If guidance simply isn't applied there, the layout forms with less pushing and you keep the benefit of the high scale where it counts. The pack's showcase is explicit that the layout differs from plain CFG - that's the intended effect, not a bug, and it's where the extra prompt variety comes from.

Speed. Skipping the unconditional pass for the outside steps is real money on a 30-step SDXL run at cfg 7 - up to a third of the model evaluations can go away if your window is tight. It won't stack with step-distillation tricks, obviously; a distilled checkpoint at cfg 1 wasn't running that pass in the first place.

Install

Same one-pack install as everything else here.

ComfyUI Manager: search CFG Megapack, install, restart. comfy-cli: comfy node install comfy-cfg-megapack. By hand:

cd ComfyUI/custom_nodes
git clone https://github.com/AbstractEyes/comfy-cfg-megapack

The pack needs nothing beyond ComfyUI itself - no requirements.txt, no model downloads, just torch and the standard library through the newer comfy_api.latest node API. Tested on ComfyUI 0.38.0 / torch 2.11. Set CFG_MEGAPACK_VRAM_FRACTION=0.6 before launch to cap its GPU memory on a shared card.

Output is one MODEL: loader → this node → KSampler.

Traps

  • It's a "when" node, so schedules replace it. With training intervals and any guidance schedule all writing the same stage of the plan, a later node in the chain wins and the earlier one is simply gone. If you chain a schedule after this, you've replaced it, not combined it.
  • Pasting a percentage where a sigma belongs. The bounds are noise levels, not run fractions. If you want fractions, you want a schedule node.
  • The composition really does change. If you're comparing against a reference render and the layout has moved, that's the feature. A/B it against plain CFG at 14 steps-ish where the difference is stark, then decide whether you like the trade on your prompts.
CategoryCFG Megapack/papers/when to guide

Inputs (3)

NameTypeDefaultDescription
modelMODEL—
sigma_lowFLOAT0.280–100Lower bound (EDM sigma).
sigma_highFLOAT5.420–1000Upper bound (EDM sigma; 1000 = no upper bound).

Outputs (1)

NameTypeDescription
MODELMODEL—