Nodes/raylight/RescaleCFG (Ray)
ComfyUI Node

RescaleCFG (Ray)

Rescale Your CFG Result Back to Normal Size

By komikndr·Created about a year ago·Updated 2 days ago· 409
RescaleCFG (Ray)
  • ray_actors
  • ray_actors
multiplier0.70

You know the failure mode: you nudge CFG from 7 to 9 chasing prompt adherence, and suddenly everything is radioactive - blown-out highlights, oversaturated skin, colors that look like a CMYK accident. That's the CFG extrapolation running away from the model's natural output distribution. RescaleCFG is the classic fix, and RayRescaleCFG is it for Raylight's distributed workers.

The mechanism is one line of math wearing a trenchcoat. The node takes the extrapolated cond + scale * (cond - uncond) result, measures how much bigger it got than the clean conditional prediction, and scales it back down so its magnitude matches what the model "wants." The single input, multiplier (default 0.7), is how much of that correction you apply - 1.0 fully rescales to the conditional's magnitude, 0.0 is a no-op. The community-standard value has been ~0.7 since the original node shipped, which is why it's the default: it kills most of the oversaturation without flattening the CFG boost you added the CFG for in the first place.

In Raylight it's a ray_actors-in / ray_actors-out patch applied on every worker, exactly like its siblings in the pack's Raylight/extra section. Chain it in anywhere after Ray Init Actor; it composes with the other CFG-adjacent patches because each one hooks a different stage of the sampler.

Where it fits

Honestly? Less than it used to. RescaleCFG was born in the high-CFG era of SD 1.5/SDXL, where people routinely ran CFG 7–12. The modern reality, per the KB's concepts essay, is that most 2026 models are guidance-distilled and run at CFG 1 - no unconditional pass, nothing to rescale. So this node earns its keep in two places: SD 1.5/SDXL workflows in Raylight's CFG-parallel mode (the pack supports both through CFG parallelism), and any distilled model where you've deliberately bumped CFG a bit (Klein-style "CFG 1.2–1.5 fixes anatomy" territory) and want the saturation under control.

Install

Standard raylight install:

cd ComfyUI/custom_nodes
git clone https://github.com/komikndr/raylight
cd raylight
pip install -r requirements.txt

Restart, or install "raylight" via ComfyUI Manager.

Gotchas

  • If you're at CFG 1 with a negative prompt, this node has nothing to fix - the burn it corrects only exists when CFG > 1. Reach for NAG instead if you want negatives back on a distilled model.
  • Multiplier is a quality knob, not a "more is better" slider. 1.0 can flatten your image into looking like the unconditional pass. Start at 0.7, adjust by 0.05, stop.
CategoryRaylight/extra

Inputs (2)

NameTypeDefaultDescription
ray_actorsRAY_ACTORS
multiplierFLOAT0.700–1

Outputs (1)

NameTypeDescription
ray_actorsRAY_ACTORS