Nodes/ComfyUI-FFT-2D/FFT Multiply
ComfyUI Node

FFT Multiply

Multiply two spectrums and get a blur

By NobutakaKuroki·Created about a month ago·Updated about a month ago· 1
FFT Multiply
  • frequency_a
  • frequency_b
  • frequency

FFT Multiply looks like the most boring node in the pack - two inputs, one output, no knobs at all. It's actually the one doing the heavy lifting. In frequency space, multiplication is convolution in disguise: multiply two spectra together and the inverse transform gives you the convolution of the two original images. That one fact is why this pack exists. It's how you blur an image with any kernel you like, sharpen it with a custom kernel, or apply a frequency mask - without ever touching a single pixel.

What you'd use it for

Three genuinely different jobs land on this node:

  • Convolution with a PSF. Feed in the FFT of your image and the FFT of a point-spread function (a blur kernel) and you've blurred the image - that's Lesson 6 in the repo. A Gaussian-ish PSF in, a soft-focus or motion-blur look out.
  • Frequency masking. Multiply the spectrum by a mask from FFTRadialMaskGenerate - a low-pass or high-pass filter built in frequency space - to keep or kill whole bands of detail. Same idea as FFTCrossover, but you get to choose the mask rather than take the node's two-band split.
  • Sharpening by hand. Build a "boost the highs" mask and multiply. Same underlying math as the unsharp-mask recipe the post-processing folks swear by - blur, subtract, add back - just done in the frequency domain instead.

The classic pipeline is ImageFFT2DFFTMultiply (with a second spectrum) → ImageIFFT2D. That's the whole trick.

How it works

Both inputs are FREQUENCY, frequency_a and frequency_b, and the node multiplies them elementwise. Because everything in this pack is stored with DC at the center, a centered multiplication stays centered - no rotation or shifting games. The one convenience that saves beginners: if the two spectra have different sizes, the second is center-cropped or zero-padded to match the first rather than erroring out. So a (1, H, W, 1) mask generated at any size plugs straight into a (B, H, W, C) image spectrum and just broadcasts.

The single output is frequency, ready for ImageIFFT2D or further filtering.

The trap: it's elementwise, so keep your masks real

The classic beginner move is multiplying two images' spectra and expecting a sensible result. Elementwise multiplication of two arbitrary complex spectra is rarely meaningful - it's convolution only when one of them is a sensible filter or kernel. If your output looks like static, your second input isn't acting like a filter. Generate masks with FFTRadialMaskGenerate or build a proper PSF with PSFNormalize first. And remember the inverse of this node is FFTDivide, not subtraction - if you want to undo a multiply (deconvolve a blur), that's the Wiener-style node you want.

How to install it

Part of the ComfyUI-FFT-2D pack. Via ComfyUI Manager, search ComfyUI-FFT-2D and install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/NobutakaKuroki/ComfyUI-FFT-2D

Restart ComfyUI and it's in the fft category. No extra dependencies - numpy and torch only - and no model files. The repo's lesson_workflows/6_Convolution.json shows the canonical setup end to end.

Categoryfft

Inputs (2)

NameTypeDefaultDescription
frequency_aFREQUENCY
frequency_bFREQUENCY

Outputs (1)

NameTypeDescription
frequencyFREQUENCY