Nodes/ComfyUI-Prediction/Scaled Guidance Prediction
ComfyUI Node

Scaled Guidance Prediction

Add a guidance vector back to a baseline (with optional CFG rescale)

By redhottensors·Created 3 years ago·Updated 2 years ago· 15
Scaled Guidance Prediction
  • guidance
  • baseline
  • prediction
guidance_scale6.0
stddev_rescale0.0

Most nodes in this pack output a complete prediction. Scaled Guidance Prediction is the one that expects a guidance vector plus a baseline, and blends them: baseline + guidance * scale. Without it you can't do much with the guidance vectors some of the other nodes produce - notably Avoid and Erase, whose output is explicitly a guidance vector, not a finished prediction. This node is how you make those usable.

What it's for

Think of it as the "recombine" step. A guidance vector is a direction in latent space - the thing you want to move the image along. It only becomes a noise prediction when you add it to some reference prediction (usually the empty/unconditioned one). That's this node: you connect the guidance vector to guidance, the reference to baseline, pick a guidance_scale, and get a real prediction out the other end.

Three uses:

  • Recombining Avoid and Erase - that node outputs guidance; wire it here with your empty prediction as baseline. The README's stated workflow.
  • Hand-rolled CFG with rescale - put positive - negative (built with Combine Predictions) in guidance, empty in baseline, and you have CFG. Which gets you to the interesting part:
  • CFG rescale - this is the only node in the pack that does it. stddev_rescale implements §3.4 of this paper (the CFG-rescale / noise-schedule analysis paper): it rescales the guided result's standard deviation back toward the baseline's, which fights the oversaturation and "burn" you get at high CFG. The README says to start around 0.7 and tune.

Inputs and outputs

  • guidance (PREDICTION) - the vector to scale and add.
  • baseline (PREDICTION) - the reference prediction, usually your empty/negative.
  • guidance_scale (FLOAT, default 6, range 0–100) - the multiplier.
  • stddev_rescale (FLOAT, default 0, range 0–1) - how much standard-deviation rescaling to apply. 0 disables it entirely.

Output: one prediction.

How it works

Without rescale, it's one line: guidance * scale + baseline. With rescale, it reconstructs the estimated clean latent (x0) from the noisy input, computes it again for the guided result, rescales the guided x0's standard deviation to match the baseline's, and interpolates between the raw and rescaled versions by stddev_rescale. That's why it's the cure for CFG burn rather than a fix that just brightens things - it's acting on the prediction statistics, not the pixel values.

Installing it

Ships in the ComfyUI-Prediction pack by @RedHotTensors (Project RedRocket). ComfyUI Manager → search "ComfyUI-Prediction", or:

cd ComfyUI/custom_nodes
git clone https://github.com/redhottensors/ComfyUI-Prediction

Restart ComfyUI. No extra dependencies or model files. It's under Add Node > sampling > prediction.

Common issues

  • Plugging a full prediction into guidance. If your "guidance" already contains a baseline, you're double-counting. Feed it the difference vector.
  • Expecting it to fix CFG 1 models. Rescale can't create a negative pass where the architecture skips it; this is SD-lineage territory.
  • ControlNet unsupported, same as the whole pack.
Categorysampling/prediction

Inputs (4)

NameTypeDefaultDescription
guidancePREDICTION
baselinePREDICTION
guidance_scaleFLOAT6.00–100
stddev_rescaleFLOAT0.00–1

Outputs (1)

NameTypeDescription
predictionPREDICTION