ComfyUI Node

ScheduledCFGGuider

Ride a CFG curve instead of one flat number

By mfg637·Created 2 years ago·Updated about a year ago· 11
ScheduledCFGGuider
  • model
  • positive
  • unconditional
  • sigmas
  • GUIDER
cfg_max12.0
cfg_min1.0

Every KSampler you've ever used applies the same CFG number to every single denoising step. You pick 7, and step one gets 7 just like step twenty. That's a bit dumb when you think about it. Early steps are where composition gets locked in (too much guidance there and the image goes stiff and over-saturated), while late steps are where detail is being painted (too little guidance there and things smear). ScheduledCFGGuider is the node that lets you stop pretending one number is right for all of them.

It's the flagship of the ComfyUI-ScheduledGuider-Ext pack, and it slots into ComfyUI's custom sampling system - the one that uses a SamplerCustom node instead of the plain KSampler. Feed it a CFG curve, and it adjusts your guidance scale step by step as the denoise progresses.

How it works

The trick is the sigmas input, and it's the thing everyone misreads at first. It is not the noise schedule your sampler actually runs on. It's the shape of your CFG curve, expressed as a list of numbers. At each step the guider works out where that step sits along the denoising trajectory (using the model's own sigma↔percent mapping), reads the corresponding value off your curve, normalizes it between cfg_min and cfg_max, and uses that as the CFG for the step.

That's why the author suggests feeding it something like a 200-point curve even when you sample in 20 steps. More points = a smoother, more precise CFG curve, and your actual step count doesn't change at all. It's a curve definition, not a schedule.

The curve-shape math is borrowed directly from Clybius's WarmupDecayCFGGuider in ComfyUI-Extra-Samplers, so if you've seen that node's warmup/decay shape, you already know the family this comes from.

The inputs that matter

  • model, positive, unconditional - the usual suspects. unconditional is your empty-prompt conditioning; don't skip it.
  • cfg_max (12.0) / cfg_min (1.0) - the top and bottom of your guidance range. The curve is scaled between these two.
  • sigmas - the curve itself. Feed it from one of the pack's own schedulers (CosineScheduler, Parametric Peak #1, ...) or any SIGMAS-typed source.

The output is a single GUIDER, which wires into the guider socket of a SamplerCustom node. Positive and negative conditionings still come from your normal CLIP text encode, and you decode the samples with a VAEDecode afterward.

Install

ComfyUI Manager handles it - search for ComfyUI-ScheduledGuider-Ext and hit install. Or from your ComfyUI folder:

cd ComfyUI/custom_nodes
git clone https://github.com/mfg637/ComfyUI-ScheduledGuider-Ext

Then restart ComfyUI. There are no model downloads and no extra Python dependencies - it only uses torch and numpy, which you already have. That's the whole install.

Common issues

The most likely way you got here: you googled "ScheduledCFGGuider" and landed on this page, but the workflow you're following expects the other one. ComfyUI-Inspire-Pack ships nodes with the same names (ScheduledCFGGuider and ScheduledPerpNegCFGGuider), and its conflict detector will even warn you about it. Same name, different code. Check which pack the workflow's nodes actually come from before swapping.

Real gotcha: because the guider only cares about the shape of your sigmas curve, feeding it an actual denoise schedule (with real sigma values like 14.7 down to 0.03) works fine - it'll just be a mostly-flat line. If your CFG isn't visibly changing over the run, your curve is probably too flat. Give it a shape.

One more honesty note: this whole idea is aimed at SD 1.5 / SDXL-lineage models where CFG is a real, tunable knob. On guidance-distilled models - the Turbo/Lightning-era stuff that wants CFG 1 and has guidance baked into the weights - a scheduled CFG curve is mostly theater, because there's no unconditional pass to steer. Don't reach for this node on Z-Image Turbo or Klein distills; reach for it on models where CFG 5-9 actually means something.

Categorysampling/custom_sampling/guiders

Inputs (6)

NameTypeDefaultDescription
modelMODEL
positiveCONDITIONING
unconditionalCONDITIONING
cfg_maxFLOAT12.00–100
cfg_minFLOAT1.00–100
sigmasSIGMAS

Outputs (1)

NameTypeDescription
GUIDERGUIDER