Audio Spectrogram ποΈ
See Your Audio Before You Listen to It
- audio_samples
- spectrogram_image
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-linearplots 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, orgrayscale. 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:
- 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.
- 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.
- 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.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| audio_samples | AUDIO | β | |
| sample_rate | INT | 441008000β192000 | β |
| width | INT | 1024256β4096 | β |
| height | INT | 51264β2048 | β |
| fft_size | INT | 2048256β8192 | β |
| hop_length | INT | 51264β2048 | β |
| spectrogram_type | COMBO | log_power | 2 options: linear, log_power |
| colormap | COMBO | cyan_dark | 4 options: cyan_dark, viridis, hot, grayscale |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| spectrogram_image | IMAGE | β |