Nodes/ComfyUI-AutomaticCFG/Automatic CFG - Post rescale only
ComfyUI Node Runs on cloud

Automatic CFG - Post rescale only

The burn-fighting rescue without the CFG rewrite

By Extraltodeus·Created 3 years ago·Updated 24 days ago· 428
Automatic CFG - Post rescale only
  • model
  • MODEL
subtract_latent_meantrue
subtract_latent_mean_sigma_start1000.0
subtract_latent_mean_sigma_end7.5
latent_intensity_rescaletrue
latent_intensity_rescale_methodhard
latent_intensity_rescale_cfg8.0
latent_intensity_rescale_sigma_start1000.0
latent_intensity_rescale_sigma_end5.0

Every other node in this pack rewrites the CFG math itself. This one deliberately doesn't. It only runs the post-CFG cleanup: recentering the latent and rescaling its intensity after the guidance step. The README's description of why it exists is the whole pitch: it's for "fighting deep-frying images a bit more for some special cases."

Think of it as a first-aid kit you bolt onto an otherwise normal workflow. If your image is nearly done but the last stretch of sampling is where it burns - colors saturate, contrast collapses into noise - this node clamps the intensity in exactly that phase, without making you rework your CFG strategy. It's the "post rescale" half of the Advanced node, isolated so you can use it with a plain KSampler, or on top of another CFG patch, or anywhere the deep-fry smell appears.

How it works

Two independent post-CFG functions, each active over its own sigma window:

  • subtract_latent_mean - subtracts each latent's mean value before the step, which recenters the prediction and fights the brightness drift that turns into washed-out or bloomy output. Default on, active from sigma 1000 down to 7.5.
  • latent_intensity_rescale - measures the denoised prediction's dynamic range per channel (method: soft, hard, or range) and scales it to hit a target intensity set by latent_intensity_rescale_cfg, default 8. Default on, active from sigma 1000 down to 5.

Both work after CFG, so unlike the main Automatic CFG node they don't change what guidance means - they clean up what it produced. The sigma-end defaults (7.5 and 5) are telling: this is aimed at the middle-to-late phase, where over-saturation actually happens.

The inputs that matter

  • latent_intensity_rescale_cfg - the intensity target, default 8. This is the dial that controls how hard it clamps.
  • latent_intensity_rescale_method - hard (default), soft, or range, the same measurement choices as the CFG engine.
  • subtract_latent_mean - the recentering toggle; the sigma start/end fields around both toggles define when each applies, and you mostly leave those alone.

Output is a single patched MODEL for your KSampler. No text, no presets.

Honest take

This is a utility, and a niche one - the author calls it a "special cases" fix, and it's easy to over-use. If every image looks washed out after adding it, the defaults (which subtract mean aggressively at 7.5+) are probably fighting your actual look; widen the sigma-end or turn off the mean subtraction. It's also the least "pack-defining" node here, which is fine - it exists for the workflow where your render is 95% right and just needs a clamp at the end. Same install as everything else:

cd ComfyUI/custom_nodes
git clone https://github.com/Extraltodeus/ComfyUI-AutomaticCFG

Restart, and find it under model_patches/Automatic_CFG/utils. And the pack-wide rule applies: if output goes weird or black after install, update ComfyUI - this pack patches the global sampler function.

Categorymodel_patches/Automatic_CFG/utils

Inputs (9)

NameTypeDefaultDescription
modelMODEL
subtract_latent_meanBOOLEANtrue
subtract_latent_mean_sigma_startFLOAT1000.00–10000
subtract_latent_mean_sigma_endFLOAT7.50–10000
latent_intensity_rescaleBOOLEANtrue
latent_intensity_rescale_methodCOMBOhard3 options: soft, hard, range
latent_intensity_rescale_cfgFLOAT8.00–100
latent_intensity_rescale_sigma_startFLOAT1000.00–10000
latent_intensity_rescale_sigma_endFLOAT5.00–10000

Outputs (1)

NameTypeDescription
MODELMODEL