FFT Subtract
Pull one frequency band out of another
- frequency_a
- frequency_b
- frequency
FFT Subtract does exactly what the name promises: subtracts one FREQUENCY spectrum from another, elementwise, and hands back the difference. Two inputs, one output, nothing to configure. If FFTAdd is the "put the layers back together" node, this is the "isolate what's different" node.
The most useful thing it can do is subtract a low_pass from the original to get a pure high-frequency layer - which is, functionally, the sharpest thing in the pack. Remember that FFTCrossover gives you exact complements, so original − low_pass is identical to its high_pass output. That means you can build the same separation two ways, and subtraction is the more surgical one when you didn't split cleanly in the first place: subtract any spectrum you like from any other and see only the residual energy.
How it works
Elementwise complex subtraction of frequency_b from frequency_a. Both follow the pack's DC-at-center convention, so alignment is automatic, and if the two inputs have different dimensions the second is center-cropped or zero-padded to match the first rather than erroring out. Same lenient sizing rule as every math node in the pack.
You won't tune anything here. The real work is upstream - what you subtract and why. The output frequency wires straight into ImageIFFT2D or into another filter.
Where it's actually useful
- Isolate detail.
ImageFFT2D→FFTCrossover→FFTSubtract(original, low_pass)gives you a pure detail layer you can boost, threshold, or study. - Remove a known pattern. If something periodic is polluting your spectrum - a moiré pattern, a watermark band, scan noise - you can subtract a matching spectrum and knock it out. This is the same impulse behind the watermark-and-FFT work that shows up in the community now and then.
- Diff two frames. Subtract the spectrum of one frame from another to see exactly which frequencies changed between them.
The thing to keep in mind
Subtraction in frequency space is just subtraction - if the two spectra are nearly identical, you get near-zero output, and inverting that thin residual can amplify noise into static. If you want the ratio between two spectra (the "how much of this is in that" question), that's FFTDivide's job, not this node's. And remember that FFTMultiply's inverse is division, so subtracting won't undo a convolution.
How to install it
Part of the ComfyUI-FFT-2D pack. In 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 under fft, sitting next to FFTAdd, FFTMultiply, and FFTDivide. No pip dependencies beyond numpy and torch, no model files. It's from Dr. Nobutaka Kuroki's educational pack (Kobe University), MIT-licensed, so the repo's seven lesson workflows are there to crib from - 4_LowHighSplit shows the split pattern this node slots into.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| frequency_a | FREQUENCY | — | |
| frequency_b | FREQUENCY | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| frequency | FREQUENCY | — |