Nodes/ComfyUI-Riffusion/Riffusion Audio Generator
ComfyUI Node

Riffusion Audio Generator

The 'generator' that doesn't generate — turning a spectrogram image into real audio

By traugdor·Created 2 years ago·Updated about a year ago· 5
Riffusion Audio Generator
  • spectrogram
  • audio
filename_prefixRiffusion_
save_to_filefalse
max_volume50
quality_level2
apply_filtertrue

Let's get the uncomfortable truth out first: the display name says "Riffusion Audio Generator," but this node doesn't generate anything, calls no API, and needs no key. It's the second half of Riffusion. Riffusion proper is a Stable Diffusion finetune that draws spectrogram images - the little dark-on-light "pictures" of frequency over time that you see in the Riffusion web app. This node is the decoder that sits after that: it takes a spectrogram image and renders it back into an actual, playable waveform. You still need to produce the image yourself. Feed it a random picture and you get noise, not music.

Where it fits in the workflow

The spectrogram you feed it can come from the original Riffusion pipeline (riffusion/riffusion or the app), from a text-to-image graph that happens to draw spectrogram-looking art, or from any clip you've already turned into a spectrogram elsewhere. The useful pattern people actually run: generate or upscale a spectrogram, run it through this node, and pipe the resulting audio into an audio-to-video pipeline (the LTX-2 / Wan-style workflows that take a music track and animate to it). Riffusion's niche has never been studio-grade music - think 5-second musical phrases, loops, and SFX-style sketches - and this node stays in that lane. It's a niche tool, but it's the only thing filling this specific gap in ComfyUI, which is why it's worth knowing.

How it actually works

Under the hood it's torchaudio and a chunk of old-school DSP, not a neural net. The image gets flipped, inverted (dark pixels become loud), rescaled to max_volume, and run through an inverse power curve to get a magnitude spectrogram. Then InverseMelScale pushes it from mel bins back to STFT shape, and Griffin-Lim reconstructs the phase (phase is the part you can't get from a spectrogram; Griffin-Lim estimates it iteratively). A pedalboard chain - highpass at 60 Hz, lowpass at 16 kHz, a compressor - cleans it up, and the result is normalized so it doesn't clip. Output is the standard ComfyUI AUDIO dict (waveform + sample_rate, always 44100 Hz).

The inputs that matter

Three of them, really. spectrogram (required IMAGE) must be in Riffusion's format - roughly 512 mel bins tall, ~5 seconds wide, dark = loud - or you'll get a hissing mess. quality_level (0–3, default 2) sets Griffin-Lim iterations: 0 is 16 (fast, rough), 3 is 64 (slow, clean). max_volume (10–100, default 50) is your overall loudness - cranking it past ~70 tends to push the compressor into pumping. apply_filter (on by default) toggles the pedalboard chain; turn it off if you want raw output. save_to_file and filename_prefix are there if you want a WAV dropped into ComfyUI/output instead of just wiring the audio onward.

Installing it

Same path as any custom node: ComfyUI Manager (search "ComfyUI-Riffusion") or cd ComfyUI/custom_nodes && git clone https://github.com/traugdor/ComfyUI-Riffusion, then restart. The pack is also on the Comfy Registry (registry.comfy.org/publishers/traugdor/nodes/riffusion). The __init__.py pip-installs its requirements (numpy, scipy, torch, torchaudio, pedalboard) on startup if they're missing - convenient, but it means the first launch after install hangs a bit while pip works. FFmpeg is not needed for the basic WAV output (that's scipy), despite the README's emphasis - it's only required for the MP3 conversion when save_to_file is on. If it's missing you'll see a warning at startup.

Where people get burned

The classic trap is expecting this to be the whole Riffusion. It isn't - you need a spectrogram image first, and the wrong format gives you loud noise. The second trap is performance: quality 2 means 48 Griffin-Lim iterations, and on CPU that's slow enough to feel broken. Drop to quality_level 0 to prototype, then raise it for the final render. Also worth knowing: this pack isn't maintained aggressively (it's effectively a 2025-era single-author utility), so treat it as "works as shipped" rather than expecting updates.

Categoryaudio

Inputs (6)

NameTypeDefaultDescription
spectrogramIMAGE
filename_prefixoptSTRINGRiffusion_
save_to_fileoptBOOLEANfalse
max_volumeoptFLOAT5010–100
quality_leveloptINT20–3
apply_filteroptBOOLEANtrue

Outputs (1)

NameTypeDescription
audioAUDIO