Combine Latent (IFFT Mag/Phase)
The Return Trip From Frequency Space
- MAGNITUDE
- PHASE
- latent
If you've ever split a latent into its FFT magnitude and phase, you know the ride isn't over until you get back to pixels. Combine Latent (IFFT Mag/Phase) is the return trip: it takes a MAGNITUDE latent and a PHASE latent and reconstructs a spatial latent via inverse FFT. It's the exact inverse of the pack's SplitLatentPhaseMagnitude node, and together they let you edit latents in frequency space - the same trick behind the pack's Frequency-Selective Structured Noise.
Why would you bother? Because frequency space is where "shape" and "texture" live separately. Split a latent, swap the magnitude from another image in, recombine, and you've done something closer to style transfer than any pixel-space blend. Or keep the phase (which carries structure) and rework the magnitude (which carries energy/texture). Every one of those tricks ends with this node.
How it works
The mechanism is textbook FFT math, and it's refreshingly simple in code: torch.polar(magnitude, phase) builds a complex frequency-domain tensor, torch.fft.ifft2 brings it back to space, and the real part becomes the new latent. The node validates that the magnitude and phase latents have identical shapes and live on the same device before doing anything - those checks are why you get clear errors instead of silent garbage. The rest of the latent dict is carried through, so metadata survives the round trip.
The inputs that matter
MAGNITUDE- the magnitude latent fromSplitLatentPhaseMagnitude.PHASE- the phase latent fromSplitLatentPhaseMagnitude.
Output: latent (LATENT), a spatial latent ready for decode or further sampling.
Installing it
Part of Skoogeer-Noise. Manager → search "Skoogeer-Noise", or:
cd ComfyUI/custom_nodes
git clone https://github.com/ttulttul/Skoogeer-Noise
Restart ComfyUI. Deps are torch, numpy>=1.26, einops, pyyaml>=6.0.3 - nothing else to install.
Common gotchas
The two inputs must match in shape and device, or the node raises - don't fight it, that error is protecting you. If you edited magnitude or phase in between, make sure your edits preserved the shape (a resized magnitude with an original phase will error or produce mush). And a note for the curious: like its sibling Frequency-Selective Structured Noise, this node isn't in the README's node index - it ships, it works, but the source code is the only documentation. If it errors on a dtype or device mismatch, that's the standard FFT gotcha: cast things to the same dtype before combining.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| MAGNITUDE | LATENT | Magnitude latent from SplitLatentPhaseMagnitude. | |
| PHASE | LATENT | Phase latent from SplitLatentPhaseMagnitude. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |