Nodes/CFG Megapack/CFG Correct: Magnitude
ComfyUI Node

CFG Correct: Magnitude

Six anti-burn fixes behind one dropdown

By AbstractEyes·Created 5 days ago·Updated 5 days ago· 3
CFG Correct: Magnitude
  • model
  • MODEL
◄methodrescale_std►
◄strength0.70►
◄cap_ratio1.05►
◄mimic_scale4.0►
◄percentile0.995►
◄softness1.00►
◄spaceauto (the method's own)►

If you only ever install one node from the CFG Megapack, make it this one. Everything else in the pack changes what guidance does; this node changes only how big the result is, and magnitude is the part of high-CFG damage that is actually fixable with arithmetic.

It's stage 5 of the pack's seven-stage decomposition - correct - and the pack includes it as a single node with a dropdown because the six published methods it implements are variations on one theme: take the guided prediction, compare its size to the conditional prediction's, and pull it back. The paper nodes (CFG-Renorm, EP-CFG, Dynamic Thresholding, and so on) are the same ideas with their own defaults; this is the toolbox view.

The six methods

  • rescale_std - match the standard deviation of the guided prediction to the conditional one's (Lin et al. 2023). The classic over-exposure fix, and the default. Its strength is the paper's 0.7 rather than 1.0, which is the one place the defaults differ between methods.
  • norm_cap - shrink the push until its norm is at most cap_ratio times the conditional's (PMC-CFG). Set cap_ratio (default 1.05) - 1.05–1.15 is the useful band.
  • channel_norm_match - the per-pixel version from Qwen-Image's pipeline: each pixel's channel vector is rescaled to the conditional prediction's length. More surgical than a per-image match.
  • energy_preserve - match total energy, sum of squares (EP-CFG). Global and scale-free.
  • percentile_rescale - shrink each channel's spread to what a lower mimic_scale would give, at a given percentile. This is the mcmonkey dynamic-thresholding lineage, and mimic_scale (default 4) is the "I wish I was running CFG 4" number.
  • soft_clip - tone-map large pushes instead of clamping them, with softness (larger = gentler).

Which one? If the image is uniformly too hot, rescale_std. If it's locally blown out (a bright window, a hot rim light), channel_norm_match. If you're chasing the old A1111 dynamic-thresholding look, percentile_rescale. If you just want "never let guidance exceed what the model expects", norm_cap.

Inputs

Beyond model, method and space (leave it on auto):

  • strength (default 0.7, range 0–1) - blend between the uncorrected (0) and fully corrected (1) prediction. The published values are 0.7 for rescale_std and 1.0 for the others; if you switch methods and the image goes flat, this is why.
  • cap_ratio - norm_cap only. mimic_scale and percentile - percentile_rescale only. softness - soft_clip only. The rest of the inputs on the node are inert for whichever method you picked, which is mildly annoying and completely harmless.

Output is a MODEL.

Stacking - the bit that's different

Corrections are the one stage in the pack that stacks rather than replaces. Chain rescale_std then norm_cap and both run, in the order you chained them. That's genuinely useful (a gentle std match plus a hard cap is a reasonable combination) and genuinely a trap: two corrections are two answers to the same question, applied in sequence, and stacking three mostly produces grey mush. Start with one.

Everything else in the pack is replace-by-later-node. A second mix node kills the first; a second schedule kills the first. Corrections are the exception, so a chain that looks redundant may not be.

Install

# ComfyUI Manager: search "CFG Megapack" -> Install -> restart
# or:
comfy node install comfy-cfg-megapack
# or by hand:
cd ComfyUI/custom_nodes && git clone https://github.com/AbstractEyes/comfy-cfg-megapack

No requirements.txt, no downloads; ComfyUI ≥ 0.38 required.

Troubleshooting

Nothing changes. Either the correction is a no-op at your scale (a std match at CFG 5 does almost nothing - these methods exist for CFG 9+), or another pack's CFG node took the model's single CFG-function slot after this one. Check the order.

The output goes soft and grey. strength too high, or two corrections stacked. Drop strength to 0.4–0.5 first.

It costs time on distilled models. The pack's hook sets disable_cfg1_optimization, so the unconditional pass always runs while any of these nodes is installed. On a 2026 model you're supposed to run at CFG 1, there's no over-saturation to correct, and you've paid for the second pass. This is an SDXL/SD1.5-range tool.

See what it does. CFG Measure: Per-Step Probe writes per-step numbers - scale, sizes, how far guidance pushed, and the std ratio that shows saturation - to output/cfg_probe/. That std ratio is literally the quantity rescale_std corrects, so the probe is the honest way to tell whether the correction is biting.

CategoryCFG Megapack/5 correct

Inputs (8)

NameTypeDefaultDescription
modelMODEL—
methodCOMBOrescale_std6 options: rescale_std, norm_cap, channel_norm_match, energy_preserve, percentile_rescale, soft_clip
strengthFLOAT0.700–1Blend between the uncorrected (0) and fully corrected (1) prediction. The published forms: 0.7 for rescale_std, 1.0 for every other method.
cap_ratioFLOAT1.051–3norm_cap: the allowed norm ratio.
mimic_scaleFLOAT4.01–30percentile_rescale: the reference scale.
percentileFLOAT0.9950.5–1percentile_rescale: the spread percentile.
softnessFLOAT1.000.05–10soft_clip: larger = gentler.
spaceCOMBOauto (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)

NameTypeDescription
MODELMODEL—