ZeResFDG (CADE 2.5; Rychkovskiy 2025)
ZeResFDG splits your guidance in two
- model
- MODEL
Every "how do I get more prompt adherence" question ends in the same trap. Raise the CFG scale and the model listens - and you also get the saturated, oversharpened look the docs keep telling people to fix by lowering CFG, because you're amplifying one signal that carries both the layout and the fine detail at the same factor.
Frequency-decoupled guidance is the family that says those two things don't need the same scale. Coarse structure - colors, composition, the big shapes - is what over-saturates and drifts; fine detail is what actually benefits from being pushed. ZeResFDG (CADE 2.5; Rychkovskiy 2025) is the newest entry in that line in the CFG Megapack (AbstractPhil's seven-stage teardown of classifier-free guidance) and one of its 50 paper nodes, each named after the method it implements and shipped with the paper's own defaults.
The mechanism, honestly
Take the guidance difference delta = c - u (c the conditional prediction, u the unconditional). Split it with a Gaussian low-pass of blur_sigma latent pixels, so the blurred copy is "coarse" and delta minus the blur is "fine", then rebuild the difference with a weight on each band: lam_low (default 0.6) and lam_high (default 1.3). Coarse structure gets less than a full push, fine detail slightly more. That's the frequency half.
On top of that, the node can do one of two things with the rebuilt signal:
rescale_fdgruns the guided prediction, then pulls its per-image standard deviation back toward the conditional's, blended byrescale_mix(default 0.7) - the standard cure for a scale pushing contrast out of range.cfgzero_fddoes the CFG-Zero* move first: an orthogonal projectiona = <c, u> / ||u||²that subtracts the part of the conditional the unconditional already explains, so only the residual gets the frequency-shaped push. It matters most on flow models, where the early steps can be actively wrong.
mode: auto watches the run instead: it takes the share of the guidance energy sitting in the high-frequency band, smooths it into an EMA, and flips between the two rules with hysteresis (0.45 and 0.60). Credit where it's due - the source admits the paper doesn't say which side of the threshold selects which mode, so that mapping is the author's guess.
Controls that matter
- model - in and out; the output is a MODEL, so it goes into the KSampler's
modelinput or the next Megapack node. - scale - this rule's guidance scale, defaulting to -1, which means "whatever the sampler's CFG is." Set it only when you want the node to disagree with the sampler.
- mode / lam_low / lam_high / rescale_mix / blur_sigma - the paper's defaults. The three that do the work:
lam_highabove 1 buys detail,lam_lowbelow 1 calms the colors, andblur_sigmasets where the line between coarse and fine falls (in latent pixels, so the same number means something different at 512 than at 1024). - space - where the rule is computed (auto = the space the method was published in: noise for this one, velocity on flow models). It's a nonlinear rule, so unlike a schedule the space choice does change the image.
Traps
It's a combine rule, so it replaces rather than stacks. Most paper nodes write one stage of the plan and a later node of the same stage wins. Chain FDG after ZeResFDG and you haven't combined them; you've thrown ZeResFDG away. Hang CFG Plan Readout off the model and check what's actually there.
Try the neutral setting first. lam_low and lam_high at 1 with rescale_mix at 0 returns plain CFG, exactly - a free way to prove the node is live instead of guessing.
At CFG 1 there's nothing to decouple. The pack keeps the unconditional pass running - it opts out of ComfyUI's usual CFG-1 shortcut - but this whole game is about reshaping c - u on a model that has guidance baked in and is meant to run at 1. Wrong tool.
Newer paper methods sometimes look wrong on SDXL. The pack's own notes flag that pattern for a few recent nodes, so if a frequency method greys your SDXL image out, suspect that before you blame the checkpoint.
Install
No extra packages: torch and the standard library, which ComfyUI already has - but you need a recent ComfyUI (>= 0.38.0) for the comfy_api.latest node API.
# ComfyUI Manager: search "CFG Megapack" > install > restart
comfy node install comfy-cfg-megapack
cd ComfyUI/custom_nodes && git clone https://github.com/AbstractEyes/comfy-cfg-megapack
Restart, then find it under CFG Megapack > papers > frequency and space, next to FreSca, HiWave and LF-CFG. The bundled examples (Workflow > Browse Templates > Custom Nodes > comfy-cfg-megapack) render plain CFG and the variant from one seed - the only way to tell whether the two bands did anything.
Inputs (8)
| 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. |
| mode | COMBO | auto | auto switches by the high-frequency share. |
| lam_low | FLOAT | 0.600–3 | Low-band weight. |
| lam_high | FLOAT | 1.300–3 | High-band weight. |
| rescale_mix | FLOAT | 0.700–1 | Rescale blend. |
| blur_sigma | FLOAT | 1.00.1–10 | Low-pass blur. |
| 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 | — |