Nodes/Raffle/Curved Rescale CFG (Raffle)
ComfyUI Node

Curved Rescale CFG (Raffle)

CurvedRescaleCFG rescales guidance where it actually helps

By rainlizard·Created about a year ago·Updated 2 days ago· 40
Curved Rescale CFG (Raffle)
  • model
  • MODEL
multiplier1.00
curve_peak_position0.50
curve_sharpness2.10

If you've ever pushed CFG past the sweet spot on an SDXL-lineage model - say 9 or 10 on Illustrious or Pony - you've met the enemy: colors blow out, contrast burns, faces melt into posterized noise. That's not your prompt's fault. High CFG amplifies the difference between the conditioned and unconditioned predictions, and that amplified prediction can grow out of proportion to the real signal. CurvedRescaleCFG is a model patch that keeps the CFG boost but rescales the prediction back to a sane magnitude - and it only applies that rescale in the middle of the denoising schedule, where it matters.

Mechanically, it's the classic CFG rescale trick (the fix from the "Common Diffusion Noise Schedules and Sample Steps are Flawed" paper) dressed up with a curve. It patches the model's sampler CFG function, converts the predictions into v-prediction space, computes the CFG result, then rescales it so its standard deviation matches the conditioned prediction - the std(cond) / std(cfg) ratio that stops the output from blowing up. What makes it curved is the envelope: a bell curve across log-scaled denoising progress that peaks at curve_peak_position and returns to zero at the very start and end of sampling. The rescale fades in and out instead of hammering every step equally.

The inputs, all of which you'll actually set:

  • model - the checkpoint, straight from a checkpoint loader.
  • multiplier (default 1.0) - how strongly the rescale applies at the curve's peak. 0 is effectively off.
  • curve_peak_position (default 0.5) - where in the schedule the rescale is strongest. 0 is the start (high sigma), 1 is the end (low sigma); 0.5 means mid-denoising.
  • curve_sharpness (default 2.1) - how narrow the peak is. Higher = a tighter window of effect.

One output, a patched MODEL. It slots in exactly where a plain RescaleCFG would: between your checkpoint loader and the sampler. If you're running CFG 7 and wish the image obeyed a little harder, this is how you nudge toward 8–10 without everything turning orange.

The place it genuinely shines is v-prediction checkpoints. ComfyUI's own guidance for vpred models is to drop CFG to 1.5–2.0 with a CFG++ sampler, or keep CFG higher and add a RescaleCFG around 0.7. This node is that second path, with a schedule-aware envelope on top - so it pairs nicely with NoobAI vpred and friends.

The gotcha, and it's a real one: at CFG 1 this node does nothing. At exactly CFG 1, ComfyUI skips the unconditional pass entirely, and this wrapper just returns early. So on turbo and distilled models that run at CFG 1 by design, it's dead weight. This is a tool for real-CFG models - SD 1.5, SDXL, Illustrious, NoobAI, Pony at their normal ranges. Don't bolt it onto a Lightning/Turbo checkpoint and expect a miracle.

Install is the same as the rest of this pack - it ships inside ComfyUI-Raffle:

cd ComfyUI/custom_nodes
git clone https://github.com/rainlizard/ComfyUI-Raffle

...or search "Raffle" in ComfyUI Manager. No extra dependencies. The one wrinkle: the pack's bulk is ~220MB of bundled taglist data, which you're paying for even if you only want this node. If that bothers you, the standalone RescaleCFG / Advanced RescaleCFG nodes do the rescale part without the curve.

Categoryadvanced/model

Inputs (4)

NameTypeDefaultDescription
modelMODEL
multiplierFLOAT1.000–1000000
curve_peak_positionFLOAT0.500–1
curve_sharpnessFLOAT2.100.01–1000000

Outputs (1)

NameTypeDescription
MODELMODEL