Nodes/ComfyUI-Prediction/CFG Prediction
ComfyUI Node

CFG Prediction

Plain CFG, as a node you can chain

By redhottensors·Created 3 years ago·Updated 2 years ago· 15
CFG Prediction
  • positive
  • negative
  • prediction
cfg_scale6.0

If you've used a KSampler, you already know this node's entire personality. CFG Prediction is vanilla classifier-free guidance - (positive - negative) * cfg_scale + negative - rebuilt as a composable PREDICTION so it can live inside a bigger prediction graph. Nothing fancy, and that's the point: it's the familiar dial you can finally chain.

Why this node exists

The pack's sampler, Sample Predictions, is deliberately dumb about prompts. It doesn't know "positive" from "negative" - you hand it a PREDICTION graph and it denoises. Which means at some point your graph needs a node that says "here, do ordinary CFG," and that node is this one. It's the prebuilt shortcut for the thing you could build out of primitives: Conditioned Prediction + Combine Predictions (A − B) + Scale + Combine Predictions (A + B). The pack just wrapped it so you don't have to.

You'll reach for it three ways, realistically:

  • As the middle strategy in a Switch Predictions or Early/Middle/Late setup - cheap, understood, dependable.
  • As the fallback for Characteristic Guidance Prediction, which uses plain CFG for any samples that don't converge if you leave fallback unconnected.
  • As a clean CFG + CFG-rescale combo, pairing it with Scaled Guidance Prediction.

Inputs and outputs

  • positive (CONDITIONING) - your main prompt, straight from CLIP Text Encode.
  • negative (CONDITIONING) - the negative prompt. It replaces the empty unconditional pass, which is exactly how ComfyUI's own CFG treats a negative prompt: two predictions per step, difference amplified.
  • cfg_scale (FLOAT, default 6, range 1–100) - the familiar guidance dial. The KB's CFG panel is your calibration chart: 5–9 for SD 1.5/SDXL, 4–6 for Pony/Illustrious, and if you're on a guidance-distilled model this whole pack is probably the wrong tool anyway.

Output: a single prediction you can wire anywhere another prediction is accepted.

One honest quirk: the minimum cfg_scale is 1, so you can't express "CFG 0" here. That's fine - below 1 the formula collapses into something useless anyway. Note this node has no CFG rescale; the README says so outright. If you want the saturation-fighting stddev rescale, that lives on Scaled Guidance Prediction and you can layer it on top.

How it works

Each denoising step, the model runs twice - once conditioned on positive, once on negative - and the pack's caching layer makes sure both predictions are computed once and reused if other nodes reference them. So a CFG Prediction feeding into, say, an interpolate or a switch costs exactly what CFG always costs: about two evals per step. The negative CONDITIONING doesn't need to be a real negative; feed it an empty-prompt encode and you get "CFG against nothing," which is the mathematically honest version of guidance.

Installing it

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

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

Restart ComfyUI afterward. No extra dependencies, no model downloads. The node lives under Add Node > sampling > prediction.

Common issues

  • You're using the wrong sampler. CFG Prediction is not a sampler. Feed its output into Sample Predictions' noise_prediction input, with sampler from KSamplerSelect and sigmas from BasicScheduler.
  • Overcooked images. Same old CFG lesson: crank cfg_scale too high and you get saturation and burn. This node won't save you from that; only stddev rescale (via Scaled Guidance) and honest tuning will.
  • ControlNet isn't supported by the pack - plan around it if your workflow needs it.
Categorysampling/prediction

Inputs (3)

NameTypeDefaultDescription
positiveCONDITIONING
negativeCONDITIONING
cfg_scaleFLOAT6.01–100

Outputs (1)

NameTypeDescription
predictionPREDICTION