MOSS-TTS Decode Tokens
The Token Stream You Can Actually Listen To
- moss_model
- tokens
- audio
- frames
Most of a MOSS-TTS workflow runs in a space you can't hear. The model thinks in audio codes at 12.5 frames per second, and normally they stay hidden inside the generate nodes. MOSS-TTS Decode Tokens drags them back out into a normal ComfyUI AUDIO clip.
Which sounds like a novelty until you've spent an hour fighting a clone that comes out as gibberish. This is the tool that tells you where the mistake is. It's also how you check a saved base voice, or the exact reference window a Concat Tokens node just built, before you spend a batch on it. Encode/decode/concat/save/load is a complete token API, and decode is the ear on it.
How it works
It's the inverse of MOSS-TTS Encode Tokens: codes go back through the model's own vocoder and come out as PCM. There is no sampling involved - no temperature, no top-k, no seed. The same codes always produce the same audio, every time. That's what makes it a diagnostic and not a generation: if two decodes of the same file differ, something upstream changed the file.
The vocoder lives in the model bundle, so the model is a required input, and the sample rate follows it - 48 kHz for the default Local-Transformer, 24 kHz for the 8B. n_vq (the number of codebooks per frame) is validated, so codes from the wrong variant stop with a clear error instead of quietly making static. Verify that error if you see it: it almost always means you encoded on one model and switched the loader to the other.
Inputs and outputs
moss_model- fromMOSS-TTS Load Model. Same variant that encoded or generated the codes.tokens- anythingMOSS_TOKENS: the output ofEncode Tokens,Concat Tokens,Load Tokens, or thetokensoutput ofSpeak/Voice Clone/Voice Continue.return_stereo(optional, defaulttrue) - keeps the codec's native stereo, identical to what every generate node in this pack outputs. Set itfalseand the channels are averaged into mono: smaller, but no longer bit-identical to the generated audio. Default-model only - the 8B's codec is mono and ignores the switch.
Outputs are audio (AUDIO at the model's native rate, ready for PreviewAudio / SaveAudio) and frames (INT - divide by 12.5 for seconds).
That return_stereo detail is worth caring about if you're feeding the result into anything that compares or mixes audio: a decoded tokens output with the default left on lines up sample-for-sample with the audio the same node emitted.
What to actually use it for
Three things, in order of how often you'll want them:
Audition the reference before a long run. Hang a decode off the token stream your chain actually assembled - the saved base voice, the concatenated sliding window - and preview it. A reference that sounds wrong here will clone wrong. Cheaper to find out now.
Find out what's in a .moss_tokens.pt file. Tokens are opaque; MOSS-TTS Save Tokens gives you a path and no guarantee the file holds the voice you think it does. Load Tokens → Decode Tokens → PreviewAudio answers it in one codec pass.
Explain the 80 ms. Voice Continue trims its first frame (default head_trim_frames = 1) off the audio output, but its tokens output is untrimmed - that's deliberate, MOSS needs the codes whole as the next prefix. So decoding those tokens returns audio that is exactly head_trim_frames longer than the audio beside it. If you were wondering why a decode doesn't match the file frame for frame, that's why. Set head_trim_frames = 0 if you need a 1:1 match.
Installing it
ComfyUI-Manager: search MOSS-TTS 1.5 by enrico. Not the other packs with "MOSS-TTS" in the title. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/eehrich/ComfyUI-MOSS-TTS-1.5.git
Restart ComfyUI. No pip dependencies - the pack's pyproject.toml intentionally declares none, leaning on the torch / torchaudio / transformers your ComfyUI already has. First load of MOSS-TTS Load Model still fetches ~9 GB of model plus ~8.5 GB of audio tokenizer unless you already have them in ComfyUI/models/moss_tts.
Troubleshooting
- "codes were made by a different model" style error - the n_vq validation doing its job. Re-encode with the model you're generating on.
- Mono output on the 8B despite
return_stereo = true- expected. The 8B is mono end to end; the switch is documented for the default model only. - Nothing plays - check the sample rate the preview is being asked for. A 48 kHz decode and a 24 kHz decode are different files, and some downstream audio tools in ComfyUI care.
- Loading the model fails with
non-default argument 'sampling_rate' follows default argument- you're on transformers 5.4.0 or 5.5.0.python -m pip install -U "transformers>=5.5.1"inside ComfyUI's Python environment, or hand-patch the tokenizer config as the pack README describes.
Worth saying plainly: this is a debugging and QC node. If your pipeline runs clean, you may never wire it. The moment a voice goes wrong, it's the first thing I'd reach for - it costs one codec pass and it removes all the guessing from a chain that is otherwise invisible.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| moss_model | MOSS_MODEL | Model bundle produced by MOSS-TTS Load Model. The vocoder is part of the model, so decode with the same variant that encoded/emitted the codes -- it also defines the output sample rate (48 kHz for the 1.7B Local-Transformer, 24 kHz for the 8B). | |
| tokens | MOSS_TOKENS | Codes to turn back into audio, shape [frames, n_vq] at 12.5 fps (1 row = 80 ms). Any MOSS_TOKENS source works: MOSS-TTS Encode / Concat / Load Tokens, or the 'tokens' output of Speak / Voice Clone / Voice Continue. | |
| return_stereoopt | BOOLEAN | true | Channel layout, passed straight to the processor's decode_audio_codes(return_stereo=...). True (default) keeps the codec's native stereo -- identical to what every generate node in this pack outputs, so a decoded 'tokens' output lines up with its own 'audio'. False averages the codec channels into one mono channel: smaller, but no longer bit-identical to the generate nodes' audio. 1.7B only: the 8B codec is mono and ignores this switch. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | Decoded audio at the model's native sample rate -- stereo on the 1.7B unless return_stereo is off, always mono on the 8B -- ready for PreviewAudio / SaveAudio. |
| frames | INT | Number of code frames decoded. Divide by 12.5 for seconds. |