Nodes/WAS Affine/Multi-Band Latent Apply
ComfyUI Node

Multi-Band Latent Apply

An EQ for your latent

By WASasquatch·Created about a year ago·Updated 5 months ago· 5
Multi-Band Latent Apply
  • latent
  • region_mask
  • LATENT
frames_per_batch0
enable_multibandtrue
gain_low1.00
gain_mid1.00
gain_high1.00
band_xover_low0.25
band_xover_high0.60
region_gain_low1.00
region_gain_mid1.00
region_gain_high1.00
feather_px0
normalize_energyfalse

Different from everything else in WAS Affine, Multi-Band Latent Apply doesn't use pattern masks at all. Instead of "apply scale/bias where a mask says so," it splits the latent into frequency bands and applies gains per band. Think of it as an equalizer for the latent: boost the high band for perceived detail, cut the low band to clean up flat areas, and use a region mask to do different EQ in the subject versus the background.

How it works

The node takes the FFT of the latent, builds a radial gain map with three bands separated by two crossover frequencies, multiplies the spectrum by the gains, and transforms back. The knobs:

  • gain_low / gain_mid / gain_high - per-band gains, all default 1.0 (no-op).
  • band_xover_low / band_xover_high - where the bands split, as normalized frequency radius. Defaults 0.25 and 0.6.
  • region_mask (optional IMAGE) - with region_gain_low/mid/high as alternate gains inside the masked area. Feather with feather_px (in latent pixels) so the boundary doesn't cut hard.
  • normalize_energy - rescale the output to the original standard deviation after shaping, so you change texture without changing brightness.
  • frames_per_batch - for 5D video latents, process frames in chunks (0 = all) to keep memory sane; 4D image latents are auto-detected.

Output: LATENT.

Why reach for it

Two situations stand out. Video: per-frame, a single static gain map can clean or enhance every frame consistently - no mask regeneration needed, unlike the pattern nodes. And region work: boost high-frequency detail only inside a mask (the subject) while cutting it in the background, which is a cheaper, more controllable cousin of "detail everywhere + smooth skies" than fiddling with content-aware masks. Because it lives in the FFT of the latent, effects are subtler than pixel-space sharpening - you're shaping the noise structure, not drawing edges.

Installing

Part of WAS Affine by WASasquatch. ComfyUI Manager → Install Custom Nodes → search "WAS Affine" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was_affine

Restart ComfyUI. ComfyUI 1.0.0+, torch and numpy.

Common issues

All gains default to 1.0, so if you plug it in and change nothing, it does nothing - that's the intended safe state, not a bug. If you boost the high band hard, you can push the latent out of its comfortable range and get speckle or color shifts; normalize_energy is the first thing to flip on when that happens. And remember the crossovers are normalized frequency radius, so moving band_xover_low above band_xover_high inverts your bands - an easy silent mistake if you're dialing both at once.

Categorynoise/generation

Inputs (14)

NameTypeDefaultDescription
latentLATENTExisting latent to shape. Shape is auto-detected (4D image or 5D video).
frames_per_batchoptINT00–128For 5D video latents, process this many frames per batch (0 = all).
enable_multibandoptBOOLEANtrueEnable frequency-domain shaping of low/mid/high bands.
gain_lowoptFLOAT1.000–4Low band gain.
gain_midoptFLOAT1.000–4Mid band gain.
gain_highoptFLOAT1.000–4High band gain.
band_xover_lowoptFLOAT0.250–1Low/Mid crossover (normalized radius).
band_xover_highoptFLOAT0.600–1Mid/High crossover (normalized radius).
region_maskoptIMAGEOptional mask [M,H,W,C] to apply alternate band gains inside the region.
region_gain_lowoptFLOAT1.000–4Alternate low-band gain in region.
region_gain_midoptFLOAT1.000–4Alternate mid-band gain in region.
region_gain_highoptFLOAT1.000–4Alternate high-band gain in region.
feather_pxoptINT00–64Feather radius (latent pixels) for mask blending.
normalize_energyoptBOOLEANfalseNormalize output to original std after shaping.

Outputs (1)

NameTypeDescription
LATENTLATENT