Nodes/OmniNodes/Audio Spectrogram πŸŽ›οΈ
ComfyUI Node

Audio Spectrogram πŸŽ›οΈ

See Your Audio Before You Listen to It

By TensorVizionΒ·Created 3 months agoΒ·Updated about 8 hours agoΒ· 0
Audio Spectrogram πŸŽ›οΈ
  • audio_samples
  • spectrogram_image
β—„sample_rate44100β–Ί
β—„width1024β–Ί
β—„height512β–Ί
β—„fft_size2048β–Ί
β—„hop_length512β–Ί
β—„spectrogram_typelog_powerβ–Ί
β—„colormapcyan_darkβ–Ί

A spectrogram is a picture of sound - time along one axis, frequency up the other, brightness = energy - and Audio Spectrogram renders one as a normal ComfyUI IMAGE tensor. That means your audio becomes something every image node in the graph can touch: preview it, save it, compare two tracks visually, even use it as a weird texture source if you're so inclined. It's the "show me what this sound actually is" node.

How it works

It runs a short-time Fourier transform (STFT) on the audio - the same FFT math as the pack's other audio analysis - and maps the resulting magnitudes to pixel brightness across the image. The settings that matter:

  • spectrogram_type - linear plots raw magnitude; log_power (default) compresses the scale so quiet details are actually visible. Log is almost always what you want; linear tends to be one bright band of lows and a wall of black above it.
  • colormap - cyan_dark, viridis, hot, or grayscale. Aesthetic choice, and it matters more than you'd think if you're comparing spectrograms across renders - pick one and stick with it so differences are real, not color-encoding artifacts.
  • width / height - output resolution of the image.
  • fft_size (2048) / hop_length (512) - the frequency/time resolution of the analysis. Bigger FFT = finer frequency detail, coarser time; smaller hop = finer time. The defaults are a good balance; you'll know you need to change them if the vertical stripes smear or the horizontal bands mush together.

The single output is spectrogram_image, an IMAGE tensor.

Why you'd actually use it

Three honest uses, in rough order of usefulness:

  1. Quick sanity check. Before you build a whole audio-reactive workflow, glance at the spectrogram. A track that's a flat band of bass with nothing above 1kHz will behave differently than a full-spectrum track. You learn more in one second of looking than a minute of listening to a loop.
  2. Visual comparison. Generate two versions of an audio clip, render both spectrograms, and compare the images directly - a diff you can see rather than hear. Especially useful when the difference is subtle EQ or reverb that your ears are tired of.
  3. Browsable archive. A thumbnail spectrogram in a contact sheet tells you what a batch of audio files actually is without loading each one.

Install and gotchas

ComfyUI Manager β†’ search OmniNodes, or:

cd ComfyUI/custom_nodes
git clone https://github.com/TensorVizion/OmniNodes

Restart ComfyUI; it's under TensorVizion/Audio. Pure NumPy/Pillow, no extra dependencies.

The pairing worth knowing: its sibling Audio Waveform shows amplitude over time (loudness), while this shows frequency over time (content). They answer different questions - waveform for "how loud," spectrogram for "what's in it." If you want both views, run both; they're cheap. One gotcha: spectrograms of long clips at the default 1024px width will squish a lot of audio into a few pixels per second - for a 3-minute track you're compressing ~180 seconds into 1024 columns. That's fine for a sanity check, but it's a low-res overview, not a forensic analysis.

CategoryTensorVizion/Audio

Inputs (8)

NameTypeDefaultDescription
audio_samplesAUDIOβ€”
sample_rateINT441008000–192000β€”
widthINT1024256–4096β€”
heightINT51264–2048β€”
fft_sizeINT2048256–8192β€”
hop_lengthINT51264–2048β€”
spectrogram_typeCOMBOlog_power2 options: linear, log_power
colormapCOMBOcyan_dark4 options: cyan_dark, viridis, hot, grayscale

Outputs (1)

NameTypeDescription
spectrogram_imageIMAGEβ€”