LF-CFG: low-frequency improved CFG (Song & Lai 2025)
Stop spending guidance on the parts of the image that stopped moving
- model
- MODEL
Here's a thing you can see if you watch a sampler work: the guidance signal in large flat regions - sky, walls, a backdrop - barely changes from step to step. It's already decided. LF-CFG (Song & Lai, arXiv 2025) finds those regions, figures out which parts of the guidance are just repeating themselves, and scales that part down. Everywhere else gets ordinary CFG.
How it works
Each step, both predictions are split into a low-frequency and a high-frequency component. The low-frequency part is what you get after downsampling and smoothly resampling back up, and it's where the broad structure lives - exactly the thing that settles early.
The node then measures, per pixel, how much that low-frequency component changed since the previous step. Pixels whose low-frequency guidance is changing slowly are marked as redundant. For those, the low-frequency guidance is scaled by rho instead of running at full strength; fast-changing pixels and all the high-frequency detail keep plain CFG at your sampler's scale.
The practical upshot: big calm areas keep something closer to the low-cfg look - less blown-out, less blotchy - while busy, detailed regions still get the full push you asked for. Same reasoning as a frequency-band node, but the discriminator is time rather than frequency: guidance that isn't saying anything new doesn't get to shout.
Two costs, both zero: no extra model evaluations, and no extra latent buffers beyond one stored low-pass pair.
The inputs
scale- the guidance scale for this rule;-1(default) uses the KSampler's cfg. Left alone, as usual.rho- the scale applied to the slow low-frequency part. Default0.5. Set it to1and you're back to plain CFG, which is your control. This is the knob that decides how much of the image gets the gentler treatment.k- the low-pass downsampling factor, default8. Smallkmeans "low frequency" covers finer structures too, so the damping reaches further into the image; largekrestricts it to the broadest shapes and colour fields.space-autoputs the rule where the paper does (noise on epsilon models, velocity on flow models). Don't override it; the redundant-region test is a comparison between steps, so getting the space wrong changes which pixels qualify.
Output is a single MODEL, so the wiring is the usual: checkpoint → LF-CFG → KSampler.
Install
It's the same install for the whole pack, no matter which node you're after.
ComfyUI Manager: search CFG Megapack, 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
Restart. Nothing to compile, nothing to download, no requirements.txt - the pack runs on torch and the Python standard library through ComfyUI's newer node API (comfy_api.latest), which is also why its source has no NODE_CLASS_MAPPINGS dict. It was tested on ComfyUI 0.38.0 with torch 2.11, on GPU and CPU-only. On a shared GPU, CFG_MEGAPACK_VRAM_FRACTION=0.6 before launching caps its share of video memory.
Traps
- It carries step-to-step state, so the first step is plain CFG. There's no history to compare against yet. That's the design, not a stutter.
- A fresh run resets the history. Two-pass workflows are two runs as far as the pack is concerned.
rhoabove 1 does the opposite of what it says. The tooltip's range goes to 2 of course, but anything above 1 means more guidance on the parts of the image that are already settled - a fine experiment, a bad default.- Frequency-node slot rules apply. Chained after FDG, FreSca or HiWave, this replaces it rather than combining with it - same stage, last node wins.
- Another pack's CFG node chained after the chain takes ComfyUI's single CFG-function slot. If LF-CFG looks like it does nothing, look at what you chained last.
It's a mild node. On a 30-step run at cfg 7 you'll mostly notice it in the backgrounds and the flat colour areas - which is, notably, exactly where high-cfg SDXL goes ugly.
Inputs (5)
| 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. |
| rho | FLOAT | 0.500–2 | Scale on the slow low-frequency part (1 = plain CFG). |
| k | INT | 82–32 | Low-pass downsampling factor. |
| 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 | — |