Epsilon Scaling (Ning et al. 2024)
A 0.5% nudge that quietly fixes over-exposure
- model
- MODEL
If you have ever run SDXL at 12 steps to keep the queue moving and gotten back something that looks like it was left in the sun, that failure mode has a name and a paper. Epsilon Scaling (Ning, Li, Su, Salah & Ertugrul, ICLR 2024) says the sampler's trajectory drifts, the drift shows up as over-exposure, and you can correct most of it by dividing the predicted noise by a number barely bigger than 1.
That is the entire method. You are not getting a new look out of this node; you are getting a correction for a specific, recognizable defect.
How it works
At each step the pack runs plain CFG first - u + w (c - u), exactly what your sampler would have done - and then reworks the answer in the form the paper writes it: x0' = x_t - (x_t - x0) / factor. Undo the algebra and it is simply the noise estimate divided by factor. Everything the sampler sees downstream shifts by half a percent in the direction that undoes the bias.
The pack computes this in the space the method was published in when space is left on auto, and the space conversions run in float64, so a neutral setting is bit-for-bit plain sampling rather than "close enough".
The inputs that matter
factor- the divisor. Default1.005, and the whole legal range is0.9to1.1. That narrowness is deliberate: the paper's sweet spot sits right around the default, so treat this as a fixed correction you occasionally nudge, not a dial you sweep.scale- the guidance scale for this rule.-1(the default) means "use whatever the KSampler's cfg says", which is what you want almost always.space- where the rule is computed.auto (the method's own)is correct here; the rule is a single division, so the alternatives rarely buy you anything.
Output is a single MODEL, patched. Wire it in like any other model patch.
Installing it
CFG Megapack is one pack with one install, so this is the same for all of its 50-plus nodes.
ComfyUI Manager: search CFG Megapack in the Custom Nodes Manager, install, restart. comfy-cli: comfy node install comfy-cfg-megapack. By hand:
cd ComfyUI/custom_nodes
git clone https://github.com/AbstractEyes/comfy-cfg-megapack
Then restart ComfyUI. There is no requirements.txt because there is nothing to install - the pack uses torch and the Python standard library, which you already have. It's written against ComfyUI's newer node API (comfy_api.latest) and was tested on ComfyUI 0.38.0 with torch 2.11. On a shared GPU you can cap its memory share with CFG_MEGAPACK_VRAM_FRACTION=0.6 before launching ComfyUI.
Wiring it and the traps
The chain is boring on purpose: Load Checkpoint → Epsilon Scaling → KSampler. Every node in this pack patches the MODEL; the sampler still runs the loop.
Four things that catch people:
- The
scalefield is not a strength. Set it to-1and tune cfg on the KSampler, the way you always have. Set it to a number and you have overridden cfg for this rule only, which is a confusing way to debug. factorof 1.0 is off. The pack's whole design guarantee is that neutral settings reproduce plain sampling pixel for pixel, so if you setfactor: 1you should get your old image back exactly. That's a useful A/B check, not a bug.- Another pack's CFG node chained after this one wins. RescaleCFG, Mahiro and RenormCFG from other packs share ComfyUI's single CFG-function slot with this pack, and the node chained last takes it. If the node seems to do nothing, chain it last, or use this pack's own version.
- Don't expect fireworks. On a 50-step run the difference is subtle. The honest place to use it: low step counts, high cfg, or a prompt that keeps coming back blown out. And on guidance-distilled checkpoints running at cfg 1 there is no unconditional pass to scale away, so the node has nothing to work with - check what your checkpoint is built on before you attribute a bad image to a 0.5% divisor.
If you want to see the effect rather than squint at two images, chain CFG Measure: Per-Step Probe after it and read the std-ratio column - that's the saturation number this correction is aiming at.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| scale | FLOAT | -1.0-1–100 | The guidance scale w for this rule. -1 uses the sampler's cfg value. |
| factor | FLOAT | 1.0050.9–1.1 | The divisor (1 = off). |
| space | COMBO | auto (the method's own) | Where the rule is computed. Linear rules give the same image in any space; nonlinear ones do not. 'auto' uses the space the method was published in (noise for most, denoised for APG and the angle rule, velocity for flow models). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |