ComfyUI Node

Plot Specgram

Straight from audio to a spectrogram image, one node

By kale4eat·Created 2 years ago·Updated about a year ago· 23
Plot Specgram
  • audio
  • graph_image
titleSpectrogram

The fast path to a spectrogram picture. This pack also has a two-step route - SDT_Spectrogram to compute the frequency data, then SDT_PlotSpecgram's sibling SDT_PlotSpectrogram to render it - but if all you want is a quick look at a clip's spectral content, this node skips the intermediate step entirely: audio in, image out.

How it works

It computes the underlying spectrogram from the raw waveform internally and renders it directly as an image in one pass. There's no separate spectral data exposed anywhere in this node - it's a convenience wrapper, not a building block. That's the trade-off against the two-step SDT_SpectrogramSDT_PlotSpectrogram path: you get a picture fast, but you can't reuse the underlying frequency data for anything else in your graph, and you don't get control over the FFT parameters the way SDT_Spectrogram exposes (n_fft, win_length, hop_length).

The inputs and outputs that matter

  • audio - the clip to visualize.
  • title (default "Spectrogram") - cosmetic label on the plot, nothing else.
  • graph_image (output, IMAGE) - the rendered spectrogram.

How to install it

Via ComfyUI Manager: search ComfyUI-speech-dataset-toolkit, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/kale4eat/ComfyUI-speech-dataset-toolkit
cd ComfyUI-speech-dataset-toolkit
pip install torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt

No extra dependencies - pure signal processing and plotting on top of the pack baseline.

Common issues & troubleshooting

Wanted to reuse the spectrogram data elsewhere in the graph, not just view it. Not possible from this node - it only outputs an image, no SPEC value. Switch to SDT_Spectrogram feeding into SDT_PlotSpectrogram if you need the underlying data for anything besides a picture.

Wanted control over FFT window size, hop length, or similar. Same answer - this node has none of those knobs, by design, in exchange for the one-step convenience. SDT_Spectrogram exposes n_fft, win_length, and hop_length if you need that control.

Not sure whether to reach for this or SDT_PlotSpectrogram. Use this one when you just want to glance at a clip's spectral content. Use the two-step path when you're already computing a SPEC for another purpose (feeding a model, comparing two representations) and want the plot as a byproduct rather than the goal.

Why two differently-named nodes for what sounds like the same thing. The "specgram" vs "spectrogram" split mirrors a naming convention that shows up elsewhere in audio tooling - a quick one-call plotting function versus a proper two-step compute-then-render path. If you only remember one distinction: SDT_PlotSpecgram (this node) never exposes the underlying data, SDT_PlotSpectrogram always requires it as an explicit input.

Categoryspeech-dataset-toolkit/visualize

Inputs (2)

NameTypeDefaultDescription
audioAUDIO
titleSTRINGSpectrogram

Outputs (1)

NameTypeDescription
graph_imageIMAGE