Fourier Analysis
Look at an image's frequency spectrum — with zero expectations
- image
- Image
Fourier Analysis does exactly one thing: takes an image, computes its 2D Fourier transform, and outputs a picture of the frequency spectrum. The pack's own README is refreshingly honest about the motivation - "Some people claim some stuff about AI and repetitive patterns being visible in the fourier analysis. Don't ask me, I'm not a scientist, I just think they look cool."
That's the right attitude to bring. This is a curiosity/forensics toy, not a detection tool, and treating it as a magic "is this AI?" scanner will only disappoint you. What it is good for is spotting periodic structure - and there's genuine signal in that.
How it works
Feed it one image (IMAGE input); out comes Image, the spectrum visualization, same dimensions as the input. Internally it runs fft2 + fftshift from scipy on each RGB channel separately, takes log(1 + |magnitude|), and min-max normalizes each channel to 0–255. A few things that fall out of that implementation:
- It's per-channel, not luminance, so the spectrum image comes out colored rather than the classic grayscale power-plot. Aesthetic choice; fine.
- Low frequencies land in the center, which is why the output looks like a bright blob with spikes radiating out.
- It's an output node, so it forces its branch to run and shows up in your preview pane.
What the spectrum actually tells you
A Fourier transform breaks an image into repeating patterns of different frequencies. The practical payoff: periodic texture shows up as bright dots or cross-shaped spikes in the spectrum, and the geometry of those spikes maps to the size and direction of the repetition. That's why the "AI artifacts" folklore has a kernel of truth - upscaler tile patterns, grid artifacts, and certain sampler noise can leave regular marks in the frequency domain, and AI-detection forensics does look at spectrum/profile structure. Some detector-evasion tools even manipulate the frequency profile to hide exactly those patterns. So this isn't pure woo.
But here's the catch, and it's the same catch every amateur FFT journey hits: camera photos have frequency structure too - lens blur, demosaicing, JPEG blockiness all leave their own fingerprints. A weird spectrum is not a verdict. The README's "don't ask me, I'm not a scientist" is your cue. Use this node to notice things - "huh, my upscale is leaving a regular grid" - and confirm with the image itself, not to make claims.
Also note the node computes the transform of the image as-is. If you want to inspect a specific region (say, a suspicious repeating patch of texture), crop first - a global spectrum averages everything away.
Installing it
Part of the ComfyUI-StringsAndThings pack. ComfyUI Manager: search "ComfyUI-StringsAndThings" → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/PressWagon/ComfyUI-StringsAndThings
Dependency note: this is the one node in the pack that genuinely needs scipy (scipy.fftpack does the transform). If you install manually, pip install scipy if it's not already in your ComfyUI environment - Manager's requirements.txt install usually handles it.
Caveats
- Only the first image of a batch is processed; the node silently squeezes off the batch dimension.
- The output is a visualization, not numbers. There's no text readout of frequencies or magnitudes, so it's for eyeballing, not measuring.
- Brightness normalization is per-channel min/max, so the image's overall exposure shifts what you see. Comparing two renders side-by-side is more informative than staring at one spectrum in isolation.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Image | IMAGE | — |