(deforum) InverseFFTNode
The Other Half of the Spectrum Round Trip
- magnitude
- phase
- time_domain_signal
A forward FFT turns audio into magnitude and phase. This node is what turns them back. (deforum) InverseFFTNode takes an amplitude series and a phase series, recombines them into a complex spectrum, and runs the inverse FFT to recover a time-domain signal. It's the return leg of the round trip: analyze a track in the frequency domain, mutate it, then reconstruct it.
It ships in XmYx's Deforum Nodes pack - the ComfyUI port of the animation engine that made A1111's Deforum extension famous from late 2022 (covered in the KB's ui-history essay). What's notable is that the author filed it under signal_processing, not deforum/audio - it's a general-purpose utility that doesn't care where your magnitude and phase came from. You could feed it Deforum's audio chain, or an experiment entirely outside animation.
How it works
The math is three lines:
- Build the complex spectrum:
magnitude * exp(1j * phase)- this is exactly how a magnitude/phase pair encodes a full Fourier spectrum. - Run
np.fft.iffton it. - Return the real part, since for real-world audio the imaginary part is just floating-point dust.
If magnitude and phase have different lengths, it raises a ValueError rather than silently doing something wrong - which is the correct behavior and also the failure mode you'll actually hit, because these two inputs almost never come from sources that agree on length by accident.
Inputs and output
- magnitude (AMPLITUDE) - the per-bin amplitudes.
- phase (AMPLITUDE) - the per-bin phases, same length as magnitude. The natural source is ExtractDominantNoteAmplitude's
phase_amplitudeoutput, or a phase series from anywhere else in the FFT pipeline. - time_domain_signal (AMPLITUDE) - the reconstructed signal, same type so it can keep flowing through the audio chain.
It pairs naturally with the pack's AmplitudeToAudio node, which takes a reconstructed signal (plus a sample rate) and turns it back into an AUDIO object you can save - the full analyze → modify → resynthesize → render loop, entirely inside the graph.
Installing it
Part of the Deforum Nodes pack:
cd ComfyUI/custom_nodes
git clone https://github.com/XmYx/deforum-comfy-nodes.git
Restart, or install through Manager → "Deforum Nodes" by XmYx. The usual pack caveats apply: heavy dependency install (deforum-studio from git, librosa, moviepy, av, pydub, opencv-contrib, numpy<2.0.0), Python 3.10 per the README.
Common issues
The shape-mismatch ValueError is the one you'll meet first, and it usually means you're pairing outputs from different analysis nodes that sliced the spectrum differently - fix the upstream chain, don't fight the node. The bigger conceptual gotcha is that resynthesis is lossy: if you feed back the same magnitude/phase you extracted, you get the original signal back (up to the real-part truncation), but as soon as you filter, smooth, or threshold the spectrum between FFT and IFFT, you're designing a new sound, not restoring the old one. That's the feature, but people sometimes expect a transparent loop. And if the pack itself won't load, the classic orphaned A1111 deforum package is your first suspect - pip uninstall deforum, then retry.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| magnitude | AMPLITUDE | — | |
| phase | AMPLITUDE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| time_domain_signal | AMPLITUDE | — |