Nodes/ComfyUI/RescaleCFG
ComfyUI Node Runs on cloud

RescaleCFG

The antidote to oversaturated high-CFG renders

By Comfy-Org·Created 4 years ago·Updated about an hour ago· 129,962
RescaleCFG
  • model
  • MODEL
multiplier0.70

RescaleCFG fixes a specific and recognizable problem: you raise the CFG scale to force better prompt adherence, and the image comes back with colors so hot they look airbrushed. The standard CFG formula doesn't just steer the model - it inflates the magnitude of the prediction, and beyond a point that inflation reads as oversaturation and baked-in contrast. RescaleCFG is a patch that lets you use a high CFG scale while rescaling the result back to a healthy magnitude. The multiplier input (default 0.7) sets how much of that rescaling you want.

Where you'll actually use it: it was built for v-prediction models, and its classic home is SDXL-style workflows where people run CFG 7-8 and hit the saturation wall. It's the ComfyUI-native implementation of the CFG rescaling idea from the Common Diffusion Noise Schedules and Sample Steps are Flawed research. The node is small, the effect is real, and it's one of those patches that makes you wonder why it isn't just on by default.

How it works

This is a sampler-CFG patch, so it replaces how the model computes the guided prediction. The implementation reads cleanly from comfy_extras/nodes_model_advanced.py:

  1. It converts the input to the v-prediction domain - the math assumes v-pred, and there's an explicit comment in the source that "rescale cfg has to be done on v-pred model output."
  2. It computes the normal CFG result (uncond + scale * (cond - uncond)).
  3. It measures the standard deviation of the plain conditional (ro_pos) and of the CFG result (ro_cfg), then scales the CFG result so its std matches the conditional's - x_cfg * (ro_pos / ro_cfg).
  4. Finally it blends between the rescale and the raw CFG result using multiplier.

So at multiplier = 1 you get full magnitude correction; at 0 you get plain CFG. 0.7 is the widely-used middle ground - most of the saturation tamed, none of the prompt-adherence benefit lost.

Inputs and what to set

  • model - the model to patch.
  • multiplier - float, default 0.7, range 0 to 1. That's the whole interface. 0.7 is the community-standard value; use 1.0 for the strongest correction on badly-saturated renders, lower it toward 0 if the image starts looking washed out or under-contrasted.

Output is the patched MODEL for the sampler. Ships with ComfyUI core; nothing to install.

Common issues & troubleshooting

It's tuned for v-prediction. On an eps-prediction model the rescaling math is wrong by construction - the source is explicit about it. If you slap it on a flow-matching model expecting the same effect, you'll get either nothing or a subtle wrongness. Check what your model predicts before adding it.

Washed-out output means too much rescale. At multiplier near 1 with an already-low CFG, the magnitude correction can flatten contrast. Drop toward 0.5-0.6, or raise CFG slightly to give the rescale something to work with.

It replaces the sampler CFG function. Chain it after another CFG patch (like RenormCFG) and only one effectively runs per step. Decide which correction you want and let that node sit closest to the sampler.

Categorymodel/patch

Inputs (2)

NameTypeDefaultDescription
modelMODEL
multiplierFLOAT0.700–1

Outputs (1)

NameTypeDescription
MODELMODEL