Spectrogram to Audio
Got a Hidden Audio File in a Picture? This Node Digs It Back Out
- image
- audio
That weird rainbow-striped PNG in an ARG puzzle, the "album art" that's way too regular to be real, the image someone told you to "listen to" - that's a spectrogram, a picture of audio. The SpectrogramDecoder node (displayed as Spectrogram to Audio) is what pulls the sound back out, entirely inside ComfyUI. It's the receive half of the ComfyUI ARG Toolkit's audio story, paired with the pack's SpectrogramEncoder (Audio to Spectrogram): encode a message into a picture, post the picture somewhere, and anyone with this node can render it back into a waveform and hear what you actually said.
A word up front so you don't get surprised later: this is pure DSP, no ML model involved. There are no checkpoints to download, no VRAM cost, nothing to fetch. It's a handful of well-trodden signal-processing routines wired into a node, which is exactly what you want in a steganography toolkit - it makes the hidden payload deterministic and recoverable, instead of a coin flip through a neural net.
How it works
Peek at the source and the pipeline is clear. The node flips the image vertically, then collapses it from three color channels down to a per-frame magnitude profile. If you set channel to colormap it projects each pixel onto the low/mid/high color gradient you define (those colormap_low/colormap_mid/colormap_high hex strings) to recover the exact value the encoder mapped in. Otherwise it takes luminance (proper ITU-R BT.601 weighted brightness) or a single RGB channel.
Then the numbers get scaled back to linear amplitude - for the Logarithmic methods it inverts the dB scale (10^(norm*top_db - top_db)/20); for Linear/Quadratic it peak-normalizes, either automatically (autogain) or against your max_amp. And finally Griffin-Lim - a classic phase-reconstruction algorithm - turns that magnitude profile into an actual waveform. The output is a standard ComfyUI AUDIO dict, so it wires straight into any audio-save or preview node.
The inputs that matter
For a beginner, honestly, there are four:
image- the spectrogram image you're decoding.scaling_method- must match whatever was used to make the image. The defaultLogarithmicis the common one; pickLogarithmic Melif you see a warped (mel) spectrogram,Linear/Quadraticfor un-logged ones. This is the field that silently ruins your decode if you guess wrong.window_size/hop_size- frame size and overlap in milliseconds (defaults 25 / 15). Same rule: these have to match the encoder. This is the classic ARG pain point - when you're handed someone else's spectrogram image you don't know their parameters, so decoding becomes trial and error.max_iter- Griffin-Lim iterations (default 32). More = cleaner phase reconstruction, but slower.
Also worth knowing: channel defaults to luminance, but if the image was made with a known colormap, switch to colormap for a much cleaner recovery. sampling_rate (default 44100) sets the output rate; the optional mel_scale toggle picks HTK vs Slaney mel scaling. gl_momentum at 0.99 enables Fast Griffin-Lim - set it to 0 to disable.
Installing it
Through ComfyUI Manager, search "ComfyUI ARG Toolkit" and install. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/AzelusLightvale/ComfyUI-ARG-Toolkit
Then restart ComfyUI. The pack needs torchaudio for this node (plus torch and numpy for the rest of the toolkit) - ComfyUI Manager handles that, and if you get a ModuleNotFoundError for torchaudio when running the node, pip install torchaudio in your ComfyUI environment fixes it. No model files, no API keys.
Common gotchas
The big one is parameter mismatch: decode with different window_size/hop_size/scaling_method than the encoder used and you get noise, not a voice. Pair this node with its own encoder when you control both ends, and write your settings down for the other side.
The other thing to set expectations on: Griffin-Lim only reconstructs magnitude - phase is estimated, not recovered. Output from a decoded spectrogram is inherently a bit lo-fi and phasey, especially for speech. That's the algorithm, not a bug in this node; crank max_iter if you need better quality. Also note this is an amateur-maintained pack (the author says so themselves - tests are manual, not automated), so it's a fun ARG tool, not production audio infrastructure.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The spectrogram image to decode into audio. | |
| channel | COMBO | luminance | The color channel used to collapse and deconstruct the image. For spectrograms with a known colormap, use `colormap`, otherwise use `luminance` or any of the RGB channels. |
| window_size | FLOAT | 25.00000.001–100000 | The size of each 'frame' in miliseconds. |
| hop_size | FLOAT | 15.0000.001–100000 | The size of the overlap between each 'frames' in miliseconds |
| windowing_func | COMBO | Hanning | The windowing function to use. Unless you know what you're doing, leave this as default. |
| scaling_method | COMBO | Logarithmic | The scaling method used for the spectrogram. |
| autogain | BOOLEAN | For Linear and Quadratic scaling method, dynamically scale the amplitude based on the peak. If disabled, use `max_amp` to define it instead. If used with Logarithmic Mel scaling, will enable area normalization if used with `mel_scale=slaney`. | |
| top_db | FLOAT | 80.000–255 | The dynamic range (in negative dB) to scale against for both Logarithmic scaling methods. |
| sampling_rate | INT | 44100100–384000 | The target sample rate for the audio file. |
| max_iter | INT | 321–1024 | Maximum iteration to run the Griffin-Lim algorithm for. |
| gl_momentum | FLOAT | 0.990–2 | For use with Fast Griffin-Lim. 0 disables Fast Griffin-Lim. |
| colormap_lowopt | STRING | #000000 | The color of the lowest point of the spectrogram. |
| colormap_midopt | STRING | #B73779 | The color of the middle point of the spectrogram. |
| colormap_highopt | STRING | #FCFDBF | The color of the highest point of the spectrogram. |
| max_ampopt | FLOAT | 1.00–1 | If `autogain is disabled, this defines the maximum amplitude to scale with in Linear and Quadratic scaling. |
| mel_scaleopt | BOOLEAN | false | Mel scaling method to use. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |