FFT Divide (Wiener)
Wiener deconvolution, the closest thing this pack has to magic
- frequency_a
- frequency_b
- frequency
FFT Divide (Wiener) is the pack's party trick: it's the node that takes a blurred image and its blur kernel and tries to undo the blur. Where FFTMultiply does convolution - blurring by multiplying spectra - this node does deconvolution, the mathematical inverse. Feed it the FFT of your blurred image and the FFT of the PSF (point-spread function) that did the blurring, and out comes your best guess at the original, sharp image. That's Lesson 7 in the repo, and it's the most genuinely impressive thing in the pack.
The catch is in the name's second half: "Wiener." A naive division of one complex spectrum by another explodes wherever the denominator is near zero, which is everywhere in a real blur kernel - that's how you get a result that's 99% static. The Wiener filter tames it by adding a tiny regularization term to the denominator before dividing. That's the epsilon input, and it's the whole game.
How it works
Where a plain deconvolution would compute a / b, this node computes:
(a × conj(b)) / (|b|² + epsilon)
Multiplying top and bottom by the conjugate turns the denominator into a real, always-non-negative |b|², and epsilon keeps it away from zero so the division never blows up. Smaller epsilon means a more aggressive deblur with more noise; larger epsilon means a safer, softer result. The default is 0.001 and it ranges 0–1000.
The other two inputs are frequency_a and frequency_b - the numerator is the blurred spectrum, the denominator is the PSF spectrum (dimension-mismatched inputs get center-fitted to the first, like all the math nodes here). Output is a single frequency, ready for ImageIFFT2D.
Where it bites, and it bites
Real talk: deconvolution is fragile, and this node is the honest, educational version of it, not a magic "unblur my photo" button. It only works if you have an accurate PSF - the exact kernel that blurred the image - and real-world blur (motion blur, lens blur, compression) rarely matches a synthetic kernel cleanly. Feed it the wrong PSF and you'll get ringing halos, not sharpness. The PSFNormalize node exists precisely to get that PSF into the right form: centered so convolution doesn't shift the image, and normalized so energy is preserved. The realistic use is controlled experiments - generate a blur with a known kernel, then deconvolve it - which is what the lesson workflow does. If you're trying to rescue a genuinely damaged photo, a learned restoration model (the SeedVR2 / SUPIR lineage) will beat this every time. This node is for understanding deconvolution, and for doing it where you actually know the kernel.
How to install it
Standard for the pack. ComfyUI Manager → search ComfyUI-FFT-2D → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/NobutakaKuroki/ComfyUI-FFT-2D
Restart ComfyUI. No extra pip deps, no model downloads - pure numpy. Load lesson_workflows/7_Deconvolution.json and the bundled PSF_blur_640x480.png sample to see the intended setup, and start with epsilon low only if you're prepared for noise.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| frequency_a | FREQUENCY | — | |
| frequency_b | FREQUENCY | — | |
| epsilon | FLOAT | 0.00100–1000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| frequency | FREQUENCY | — |