Nodes/ComfyUI-DonutNodes/Donut Frequency Analysis
ComfyUI Node

Donut Frequency Analysis

A spectral 'is this AI?' diagnostic that's honest about what it can tell you

By DonutsDelivery·Created about a year ago·Updated about 12 hours ago· 25
Donut Frequency Analysis
  • image
  • diagnostics_json
  • summary_report
  • ai_assessment
  • ai_score
  • frequency_profile
analysis_bands16
target_size512
output_formatdetailed

Donut Frequency Analysis is the pack's lab coat: it runs an image through frequency-domain analysis and reports on its spectral characteristics, framed as an AI-detection diagnostic. Feed it an image and it returns five strings plus a score describing how the image's energy is distributed across frequency bands. It's the node to reach for when you want to understand an image's texture profile rather than change it.

Inputs are simple: image, plus three optional knobs - analysis_bands (8–32, default 16, how finely the spectrum is sliced), target_size (256–1024, default 512, the resolution it normalizes to before analysis), and output_format (detailed, summary, or scores_only). Outputs: diagnostics_json (the full structured dump), summary_report (readable prose), ai_assessment (its verdict text), ai_score (a FLOAT), and frequency_profile (the per-band energy breakdown as a string). Wire the FLOAT into a text or comparison node; wire the strings into Show Text to read them.

How it works, and the honest caveat

It converts the image tensor to a PIL image, runs it through the pack's ImageNoiseAnalyzer in the frequency domain, and buckets the energy into bands. The underlying claim - that AI-generated images have a telltale spectral signature, typically a distinct high-frequency falloff compared to camera-captured images - comes from a line of research on AI-image detection via FFT/frequency analysis that has real papers behind it but an unreliable track record in the wild. Detectors of this kind get fooled by compression, upscaling, and sharpening, which reshape the spectrum in ways that have nothing to do with the image's provenance.

So the honest framing: this is a diagnostic aid, not a detector you should bet on. Its most defensible uses are relative, not absolute - comparing a sharpened image against its original to see how the spectrum shifted, checking whether an upscale preserved high-frequency content, or eyeballing two outputs for texture differences you can't see in a downscaled preview. The ai_score and ai_assessment are fun to read; treat them as evidence in a conversation, not as a verdict.

Practical tips

Default to detailed on your first run to see everything, then drop to summary once you know what you're looking for. Keep target_size modest (512 is a good default) - analysis cost grows with resolution and the conclusions don't change much beyond 512. And analysis_bands is a smoothness control for the profile: more bands = more granular energy bins, fewer = a smoother curve. For most work the defaults are right.

One workflow people actually use this for: before/after upscaling or sharpening, to confirm the operation added high-frequency content rather than just interpolating. Pair the frequency_profile output with a text display node and you've got a poor man's spectrum analyzer. That's a genuinely useful niche, even if "AI detection" is overselling it.

Installing

Ships with the pack: ComfyUI Manager → search DonutNodes, or git clone the repo into custom_nodes/ and pip install -r requirements.txt with the same Python that runs ComfyUI. It needs opencv-python-headless and numpy (both in the pack's requirements) but no model downloads - this is pure computation on the image you feed it.

Categorydonut/analysis

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
analysis_bandsoptINT168–32
target_sizeoptINT512256–1024
output_formatoptCOMBOdetailed3 options: detailed, summary, scores_only

Outputs (5)

NameTypeDescription
diagnostics_jsonSTRING
summary_reportSTRING
ai_assessmentSTRING
ai_scoreFLOAT
frequency_profileSTRING