GLM-TTS Sampler
The actual GLM-TTS text-to-speech node
- model
- reference_audio
- audio
This is the node you came for. Loader gets the weights, ASR reads audio back, and the Sampler is where a voice actually speaks. Feed it a few seconds of someone talking, type what you want said, and GLM-TTS reproduces the voice saying your text - zero-shot voice cloning with no fine-tuning, no per-speaker training, and no API key anywhere in the graph.
The model behind it is worth knowing about, because it's not your average TTS. It's Z.ai's GLM-TTS, a two-stage system: a Llama-architecture LLM writes speech tokens, a flow-matching model converts those tokens into a mel spectrogram, and a vocoder renders the waveform. The RL-trained variant behind the scenes is why the prosody tends to land with actual emotion instead of the flat monotone most open TTS gives you. Its benchmark numbers (0.89 CER on the RL build) put it in the same bracket as CosyVoice and F5-TTS.
How it works
The Sampler needs a reference_audio clip. From it, the frontend extracts speech tokens, a speaker embedding, and acoustic features - that's the "voice print." Your text is normalized and tokenized, the LLM generates a speech-token sequence conditioned on both the text and the voice print, and the flow decoder + vocoder turn it into a waveform. Long text is split by sentence and generated in chunks (there's a ~750-token window), so don't feel you have to feed it haiku-sized strings.
The output is a standard ComfyUI audio dict (waveform + sample_rate) - wire it into SaveAudio, VHS, or anything else that eats AUDIO.
The inputs that matter
text- multiline, defaults to a Chinese test sentence. This is your script.reference_audio(optional in the schema, but in practice required) - the clone target. The node raises aValueErrorif it's missing, so this is the first thing beginners hit. 3–10 seconds of clean, solo speech works best; the same-language rule from the ASR node applies.reference_text- what's said in the clip. Leave it empty and the node auto-transcribes with Whisper... ifopenai-whisperis installed. It isn't in the pack's requirements, so if you skip this field without installing it, the transcription silently returns empty and your clone quality collapses with no visible error. Ground yourself now:pip install openai-whisper.seed(default 42) - sets the RNGs, so you can reproduce a take. Bump it when the current read has a weird emphasis.sample_method-ras(default) is Random Access Sampling, the model's stochastic mode with real character.greedyis the deterministic, safe read.top_pis a slight lie in naming: under the hood it maps to top-k sampling with k=25, not nucleus sampling. For most use,rasis what makes this model feel alive.use_cache(default true) - keeps a KV cache of the prompt. Leave it on; it's a speed win.
Install
Install the pack once via ComfyUI Manager (search "GLM-TTS" or "comfyui_GLM_TTS"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/karas17/comfyui_GLM_TTS
Restart, let the Loader pull the ~9 GB of weights on first run, and you're talking. Python 3.10–3.12 is expected, and this is a real GPU workload - the LLM alone is over 6 GB of weights.
Common issues
- "Reference audio is required for GLM-TTS Zero-shot generation" - the Sampler needs an
AUDIOinreference_audio. Nothing is optional about it in practice. - Voices that sound off or flat - either your clip is too long/noisy (stick to 3–10 s of clean speech), or
reference_textcame back empty because whisper isn't installed. - Audio sample rate surprises - the output rate follows the Loader's
sample_ratechoice (24 kHz or 32 kHz), so pick once and keep the rest of the chain consistent. - Same result every time when you want variety - that's the seed. Change it.
That's the whole thing: reference clip, text, sample. The pack is young and niche (this one barely registers in the wider ComfyUI community yet), but if you've been fighting F5-TTS's English bias or want Chinese voices that actually emote, this is the one you'll reach for.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| model | GLM_TTS_MODEL | — | |
| text | STRING | 你好,这是一个测试。 | — |
| seed | INT | 420–18446744073709550000 | — |
| use_cache | BOOLEAN | true | — |
| sample_method | COMBO | ras | 3 options: ras, greedy, top_p |
| reference_audioopt | AUDIO | — | |
| reference_textopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |