Adaptive HF Compressor
Treat your image's high-frequency band like an audio compressor would
- image
- image
If you've ever spent an afternoon in a DAW, you know a compressor: once a signal crosses a threshold, its level gets squeezed by a ratio, with a soft knee to make the transition gentle. This node is exactly that - except the "signal" is the high-frequency band of your image's 2D FFT magnitude, and the reason you'd reach for it is that AI-generated and over-sharpened images carry too much high-frequency energy for their own good.
This is one of the sixteen nodes in ComfyUI-Spectral-Preprocessing-Nodes, a pack built around a specific thesis: some source images encode into perfectly good latents, and others produce sparkle, colour fringing, and broken textures in Flux img2img. The difference is often frequency-domain contamination - energy sitting where natural photographs don't have it. Adaptive HF Compressor is the "over-sharpened / too synthetic" fix in that pack. It sits before your VAE Encode, cleaning the spectrum so the encoder and diffusion model start from something calmer.
How it works
The node runs a per-channel FFT, then computes the RMS magnitude of everything above hf_cutoff - that's the band it considers "high frequency." If that RMS level is below threshold, nothing happens at all; your image passes through untouched. Only energy above the threshold gets compressed: four units of excess become one unit at a 4:1 ratio, and the knee widens the transition so you don't get an abrupt cliff that rings in spatial space.
The important design detail is that it compresses the level of the HF band, not its shape. The internal structure of the spectrum survives, just quieter. Phase is never touched, so edges and spatial layout are preserved. It's the FFT-domain version of a gentle high-shelf cut, with the threshold doing the "only if it's actually too loud" work.
The inputs that matter
There are only a few you'll actually set:
threshold(default 0.15) - RMS magnitude below which the band is left alone. The tooltip is a genuinely useful hint: typical HF FFT magnitudes for natural images sit in the 0.05–0.3 range. Lower it to make the compressor bite on milder images.ratio(default 4.0) - how hard the excess gets squeezed. 4:1 is a good starting point; push toward 2:1 if things feel mushy.hf_cutoff(default 0.25) - normalised radius (0–1) above which the signal counts as "high frequency." 0.25 means you're working on the top 75% of the frequency range.strength(default 0.75) - blends between the original and the fully compressed version. Start lower and creep up.knee(default 0.05) - leave it near default; a hard knee is where spatial ringing comes from.
There are also the standard tile_size / tile_overlap pair every suppression node in this pack carries, for images above roughly 2048px - set tile_size to 512–1024 and tile_overlap to 64–128; at 0 (default) it processes the whole image in one FFT, which is fine for most work.
The single output is image - wire it into VAE Encode ahead of your Flux sampler, or into another node in the pack if you're stacking.
Installing it
This node ships inside the whole pack, so installing once gives you all sixteen nodes under Spectral Preprocessing in the node browser. Easiest route is ComfyUI Manager - search for "ComfyUI-Spectral-Preprocessing-Nodes" - or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/EdoardoGuerriero/ComfyUI-Spectral-Preprocessing-Nodes
Then restart ComfyUI. Dependencies are just numpy and scipy, both already present in a standard ComfyUI install. No model downloads, no API keys, nothing to fetch.
Where people get burned
The most common mistake is expecting a visible change in the image. This node is deliberately invisible in pixels - its job is to make the latent behave. Judge it by running the pack's FFT Spectrum Visualizer before and after, or by whether your img2img output stops sparking. If the output starts looking dull or texture-free, you've overshot: raise threshold, lower strength, or back ratio off toward 2. The pack's own tuning guide lists "over-sharpened" as this node's target, with threshold down and ratio 2–4 as the starting recipe - so if your source is honestly sharp rather than AI-smeared, it may not need this node at all.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| threshold | FLOAT | 0.1500.001–1 | RMS magnitude threshold. HF energy below this level is untouched. Typical FFT magnitudes for natural images are in the 0.05–0.3 range at high frequencies. |
| ratio | FLOAT | 4.01–20 | Compression ratio. 4:1 means that 4 dB above the threshold becomes 1 dB above it. Higher = more aggressive. |
| knee | FLOAT | 0.0500–0.3 | Soft-knee width. 0 = hard knee (abrupt). Larger values create a smoother transition around the threshold, reducing spatial ringing. |
| strength | FLOAT | 0.750–1 | Blend between original (0) and fully compressed (1). |
| hf_cutoff | FLOAT | 0.250.05–0.9 | Normalised radial frequency (0–1) above which the signal is considered 'high frequency'. 0.25 = top 75%% of the frequency range. |
| tile_size | INT | 00–2048 | Tile size for large images. 0 = process whole image. |
| tile_overlap | INT | 640–512 | Tile overlap in pixels (used only when tile_size > 0). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |