ComfyUI Node

Image_Spectrum

See the Frequencies Inside Your Image (the Image_Spectrum Node, Decoded)

By bemoregt·Created about a year ago·Updated 7 months ago· 1
Image_Spectrum
  • image
  • amplitude_spectrum
  • phase_spectrum
amplitude20

Image_Spectrum is a one-node pack that runs a 2D FFT on whatever image you feed it and hands back two visualizations: the amplitude spectrum (which frequencies are present and how strong) and the phase spectrum (where those frequencies line up). Two image outputs, no model download, no API key, no VRAM to speak of - just math. It's the kind of node ComfyUI exists for: something no stock UI has a button for, that a form-based tool like A1111 can't show you at all.

Honest expectations first: this is a niche tool, and its author (bemoregt, whose README is in Korean) clearly built it as a small utility rather than a workflow centerpiece. If you're debugging why a reference image is noisy or mushy, teaching yourself what "frequency domain" actually means, or hunting for a weird artistic effect, it earns its place. If you're looking for a daily driver, it isn't one.

How it works

The source is short and easy to follow. It takes only the first frame of the input (image[0]), converts it to grayscale with PIL, then runs scipy.fft.fft2 followed by fftshift. That shift moves the zero-frequency component to the center of the image, so you read it as: bright center = low frequencies and overall brightness, moving outward = higher and higher detail. The amplitude output is amplitude × log1p(|F|) - the log tames the enormous dynamic range (the DC component alone can be tens of millions), and the result is normalized by dividing by 255. The phase output takes np.angle() and maps −π…π into 0…1, which is why it looks like gray static. That static isn't noise: it encodes edge directions and structure, and it's genuinely informative even though it reads as garbage to the eye.

The inputs that matter

There are only two, and you mostly touch one:

  • image - any IMAGE tensor.
  • amplitude - INT, default 20, range 1–50. Despite the name it's a brightness multiplier on the amplitude spectrum, not a frequency range. This is the trap: the code does no auto-scaling, so at the default 20 a typical photo's bright center pushes past 1.0 and clips to pure white. For most real images, dial it down to 1–5 and you'll actually see detail.

Both outputs (amplitude_spectrum, phase_spectrum) are normal IMAGE tensors at the input's resolution, so they plug straight into Save Image, a Preview, or anything else that takes an image.

Installing it

Via ComfyUI Manager, search the pack title ComfyUI_CustomNode_Image2Spectrum, or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/bemoregt/ComfyUI_CustomNode_Image2Spectrum.git

Then restart ComfyUI. Despite the requirements.txt listing four packages, the only one you plausibly lack is scipy - torch, numpy, and Pillow are already part of ComfyUI. pip install scipy if it complains.

Where people get burned

Nothing here has any real community history (this node is effectively invisible on Reddit and Google), so take the gotchas from the code itself. First: it only processes image[0]. Feed it a batch or a video and you get the first frame's spectrum, silently - no per-frame output. Second: the amplitude value will bite you as described above; the default is honestly too hot for most inputs. And third, remember it discards color up front, so don't expect the hue channel to matter. If your amplitude spectrum comes out as a white blob, turn the dial down. If you want it to do something, the fun move is feeding a spectrum into a low-denoise img2img pass - the results are gloriously abstract.

Categoryimage

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
amplitudeINT201–50

Outputs (2)

NameTypeDescription
amplitude_spectrumIMAGE
phase_spectrumIMAGE