Nodes/SD HeartMuLa/SD HeartMuLa Decode
ComfyUI Node

SD HeartMuLa Decode

HeartMuLa Decode Is the Last Stop Before You Hear It

By singldev·Created 7 months ago·Updated 7 months ago· 0
SD HeartMuLa Decode
  • model
  • audio_tokens
  • audio

Everything you've generated so far - the tokens the Sampler spent all that time predicting - is still a codebook index, not audio. SD HeartMuLa Decode is the node that makes it sound like anything at all. It feeds the token frames through HeartCodec, the neural audio codec that shipped with HeartMuLa, and turns them into a real waveform you can play, save, or run through the rest of your graph.

The mechanism is straightforward, and it's worth knowing for one reason: VRAM juggling. Decode needs the codec on the GPU at the same moment the 3B generation model is sitting in memory, and on a 12GB card they don't both fit comfortably. So the node first checks where the generation model lives and, if it's on the GPU, shoves it off to CPU to free space, then lazily loads HeartCodec and runs detokenize() on your token frames. In ultra memory mode it does a pre-flight CUDA cache purge on top of that. The net effect: you see a "Offloading generation model to CPU" line in the console right before decoding, and your RAM takes a hit so your VRAM doesn't. This is exactly the kind of automatic juggling ComfyUI's --lowvram does for images, and this pack just does it itself.

Inputs are a trim two:

  • model - the same HEARTMULA_MODEL output from the Model Loader. Yes, it's required again, and yes it's the same one you already wired to Conditioning and Sampler. The codec lives inside that pipeline dict, so Decode can't work without it. Just fan the wire over.
  • audio_tokens - the audio_tokens output from the Sampler. One-to-one.

There are no optional knobs. No quality slider, no stereo toggle. What you get is what the model decided.

The single output is audio, in ComfyUI's standard AUDIO format - a waveform tensor plus a sample rate of 48kHz. That's the key to the good news: because it's the same AUDIO type the rest of the ecosystem uses, you're not locked into this pack. Wire it into a SaveAudio node to write an actual file, a VHS LoadAudio/SaveAudio combo if you're using the Video Helper Suite, a preview node to just listen, or any audio post-processing pack you've got installed.

One behavior to know about before it bites you: if decoding throws, this node doesn't crash the run - it returns a second or so of silence and prints the full traceback to the console. That's a deliberate choice so the graph doesn't die mid-batch, but it means a silent output file can masquerade as a successful run. If your render "finished" and the file is quiet, scroll the console for the ERROR: Decoding failed! line before you re-roll the seed.

My take: this is the most forgettable node in the pack, which is a compliment - it's the boring, correct bridge between model internals and your ears. The only real lesson is the offloading one: on smaller cards, expect the console chatter and let it work. And if your audio comes out silent, suspect the error trap before the model.

CategorySD HeartMuLa

Inputs (2)

NameTypeDefaultDescription
modelHEARTMULA_MODELLoaded HeartMuLa model (contains HeartCodec)
audio_tokensHEARTMULA_TOKENSAudio tokens from the Sampler node

Outputs (1)

NameTypeDescription
audioAUDIO