ComfyUI Node

(SP) Spectogram

A mel spectrogram in your graph

By c0ffymachyne·Created 2 years ago·Updated about a year ago· 22
(SP) Spectogram
  • audio_input
  • spectrogram_image
color_map
n_fft4096
hop_length128
n_mels512
top_db80

The fastest way to understand what a filter actually did is to look at the audio, and (SP) Spectogram - yes, that's the author's spelling - is the pack's visualizer. It takes your audio and renders a mel spectrogram: an image where time runs left to right, frequency runs bottom to top, and brightness is energy. One glance tells you whether that highpass actually killed the sub-bass or whether your reverb is turning into a muddy smear.

The name is a clue about the implementation: it's a mel spectrogram, not a plain one. Mel scaling compresses frequency into something closer to how human hearing perceives it (more resolution in the lows, less in the highs), which makes it better at showing you what you'd actually hear. Under the hood it's torchaudio's MelSpectrogram transform (slaney-style normalization, HTK mel scale) converted to a decibel scale, then mapped to a matplotlib colormap and exported as an IMAGE tensor. That means it drops straight into ComfyUI's normal image preview and can even feed image-processing nodes if you're feeling adventurous.

The inputs

  • color_map - viridis (default), plasma, inferno, magma, or cividis. Pure aesthetics, but they genuinely differ in how readable they are; viridis and inferno are the best for spotting low-energy detail.
  • n_fft - FFT window size, 512–8192, default 4096. Bigger = better frequency resolution, worse time resolution.
  • hop_length - 64–4096, default 128. Smaller = more time detail (and a taller/slower image).
  • n_mels - number of mel bands, 32–2048, default 512. More bands = more vertical resolution, slower to render.
  • top_db - the dynamic range shown, 10–100, default 80. Everything below -80 dB relative to the peak is treated as silence, which is what keeps the background from being noise.

One spectrogram_image output (an IMAGE, ready for the preview pane). The output is also upscaled 2x internally, so it reads nicely without extra work.

Where people get tripped up

Don't expect to tune every setting by ear - the defaults are solid, and the two knobs worth touching are n_mels (up, for cleaner-looking plots) and top_db (down, to make quiet details pop). The bigger trap is reading too much into it: this is a diagnostic view, not a mastering tool. Use it to check a Filter or EQ decision, then trust your ears. And if you're here because the pack won't load - the pinned cupy-cuda11x that the Limiter imports at startup is the usual suspect, and fixing your CUDA/cupy version brings the whole pack back.

Installing it

ComfyUI Manager → "Install Custom Nodes" → search ComfyUI Signal Processing, or:

cd ComfyUI/custom_nodes
git clone https://github.com/c0ffymachyne/ComfyUI_SignalProcessing

then restart ComfyUI. Dependencies from requirements.txt (scipy, pyfar, torchaudio, pyloudnorm, cupy-cuda11x, ...) plus matplotlib for the rendering - Manager installs the list for you. The repo is a work in progress, but this node, along with (SP) Waveform, is one of the pack's most reliable and instantly useful pieces.

CategorySignal Processing

Inputs (6)

NameTypeDefaultDescription
audio_inputAUDIO
color_mapCOMBO5 options: viridis, plasma, inferno, magma, cividis
n_fftoptINT4096512–8192
hop_lengthoptINT12864–4096
n_melsoptINT51232–2048
top_dboptFLOAT8010–100

Outputs (1)

NameTypeDescription
spectrogram_imageIMAGE