ComfyUI Node

Audio Spectrogram

A real spectrogram that also outputs an IMAGE

By alice-lab-dev·Created about a month ago·Updated about 19 hours ago· 2
Audio Spectrogram
  • audio
  • IMAGE
spectrum_min_db-100
spectrum_max_db0
start_seconds0.000
end_seconds0.000

You can't hear a click buried under a voice, or tell whether a TTS render actually has that high-frequency harshness you thought you heard. A spectrogram shows you: time on one axis, frequency on the other, loudness as color. Audio Spectrogram turns any AUDIO into an interactive dBFS spectrogram you can inspect by hovering - and unlike a preview, it hands the rendered chart back to you as an IMAGE, so you can save it, compare it, or feed it into the graph.

It's one of the 11 nodes in ComfyUI ALICE Lab Audio Tools, the fresh alpha pack (Apache 2.0, no pip deps, bilingual EN/JA) from ALICE Lab. There's a built-in spectrogram in that pack's example workflow (AUDIO → Audio Spectrogram → IMAGE), and that's the whole shape of it: analysis in, picture out.

How it works

Under the hood it's a straightforward STFT: the audio is averaged to mono, windowed with a Hann window, transformed, and converted to dBFS (with 0 dBFS referenced to a full-scale sine). The result is downsampled to about 96 frequency bins by up to 800 time columns for the interactive view, then rendered into a 900 × 520 RGB chart - title, time axis, frequency axis (up to Nyquist), and a dBFS color bar - all drawn in torch with a dependency-free bitmap font. No matplotlib, no extra Python packages. That's why the pack has zero pip requirements.

The interactive part runs in the frontend: hover to read dBFS, time, and frequency at any point, drag a range to load it into the time widgets, then run again to re-analyze that selection. When you zoom, it re-renders detail for the visible range.

The inputs that matter

  • audio - the AUDIO to analyze.
  • spectrum_min_db and spectrum_max_db - the dBFS range of the color scale. Note these are integers (default −100 and 0, min −144, max +12). If the whole chart looks like one solid color, widen the range; if it's washed out, narrow it.
  • start_seconds / end_seconds - the time window. An end_seconds of 0 means "the whole input," same convention as the pack's Media Range (Input) node.

Single output: IMAGE - the rendered chart, which is why it's marked an output node. Preview it with the usual image preview, or save it via any image saver and keep a spectrogram of every render.

Using it and the traps

The obvious workflow is QA: run a TTS output through it and confirm the spectrum looks sane (no sudden broadband noise bursts = no clicks, no full-band brick = no clipping). Drag across the region of interest and rerun for a closer look. It's also a legitimately useful artifact to attach to a save node for documentation or comparison against a reference render's spectrogram.

Two gotchas, both from the source: spectrum_min_db must be strictly less than spectrum_max_db or the node throws a clear error, and the dB inputs are whole-number integers (step 1) - you can't set a half-decibel floor even if you want to. And keep expectations calibrated: a spectrogram is a visualization, not a quality score. It'll show you what's in the signal, not whether it sounds good.

Install

# ComfyUI Manager → search "ComfyUI ALICE Lab Audio Tools" → Install → restart
# or:
cd ComfyUI/custom_nodes
git clone https://github.com/alice-lab-dev/ComfyUI-ALICE-Lab-Audio-Tools
# restart, then Add Node → ALICE_Lab → Audio

Pack-wide requirements: ffmpeg + ffprobe on the ComfyUI process PATH (macOS Homebrew paths auto-checked) and a current ComfyUI with the AUDIO type. No model downloads, no Python dependencies.

CategoryALICE_Lab/Audio

Inputs (5)

NameTypeDefaultDescription
audioAUDIO
spectrum_min_dbINT-100-144–0
spectrum_max_dbINT0-144–12
start_secondsFLOAT0.0000–86400
end_secondsFLOAT0.0000–86400

Outputs (1)

NameTypeDescription
IMAGEIMAGE