Nodes/ComfyUI/Epsilon Scaling
ComfyUI Node Runs on cloud

Epsilon Scaling

A one-percent nudge that fixes exposure bias

By Comfy-Org·Created 4 years ago·Updated 20 days ago· 121,575
Epsilon Scaling
  • model
  • MODEL
scaling_factor1.005

Epsilon Scaling is a niche patch with a surprisingly honest claim behind it: diffusion models are trained to predict noise, but at inference they run into "exposure bias" - small errors in the predicted noise compound as you iterate steps, which is part of why output drifts from the clean training distribution. This node mitigates that by scaling the predicted noise by a hair, based on the method in the paper Elucidating the Exposure Bias in Diffusion Models (arXiv 2308.15321). A 1.005 scaling factor isn't a typo. That's the whole trick.

You won't find this node in the classic SD 1.5/SDXL workflows - it's a recent addition to ComfyUI core, and it's aimed at people who want a tiny, nearly free quality bump on a pipeline they've already tuned. The paper showed the fix mostly pays off on models with lots of steps; on a 4-step distilled model there's barely a trajectory to drift along, so the effect shrinks to nothing.

How it works

It's a post-CFG patch. After classifier-free guidance computes the denoised prediction, the node reconstructs the predicted noise (input - denoised), divides it by scaling_factor, and rebuilds the denoised latent from the scaled noise. That's it - one multiplication, done after guidance, before the next step.

Why that helps: the paper's argument is that during training the model sees clean noise, but during sampling the accumulated prediction error makes the effective input slightly "off." Scaling the predicted noise down a touch compensates, nudging each step's estimate back toward the trained distribution. It's the kind of fix that's hard to see in a single image but that shows up as a consistent, small quality improvement over a batch - less accumulated drift, marginally cleaner output.

Because it hooks the sampler's post-CFG function, it applies to whatever sampler you're already using. No weights, no files - the node clones your model and attaches the function.

Inputs and what to set

  • model - the model to patch.
  • scaling_factor - float, default 1.005, range 0.5 to 1.5. Default is the paper's recommended uniform-schedule value. Values above 1 shrink the noise (smoother, slightly less risky); values below 1 grow it (more aggressive, can overcorrect into artifacts). There's very little reason to go far from 1.0.

Output: the patched MODEL for your sampler. It ships with ComfyUI core.

Common issues & troubleshooting

You won't see a dramatic change - and that's fine. If you're expecting "before/after wow," this node will underwhelm you. It's a consistency improver, not a look-changer. A/B it over a batch with the same seed and look for reduced drift, not a new style.

No effect on few-step distilled models. The benefit tracks with step count; at 4-8 steps there's barely any accumulation to correct. If you run Turbo/Lightning-style models, save yourself the node.

It stacks with, but duplicates, TSR. The sibling TemporalScoreRescaling node in the same source file also rescales post-CFG output for a different purpose (diversity control). Running both is usually overkill - pick the one whose goal matches yours.

Categorymodel/patch/unet

Inputs (2)

NameTypeDefaultDescription
modelMODEL
scaling_factorFLOAT1.0050.5–1.5

Outputs (1)

NameTypeDescription
MODELMODEL