ComfyUI Node

GLM-TTS ASR

Transcribing audio inside your GLM-TTS graph

By karas17·Created 9 months ago·Updated 8 months ago· 3
GLM-TTS ASR
  • audio
  • text
languagezh

The pack is called comfyui_GLM_TTS, so you'd expect all three nodes to make speech. GLM-TTS ASR is the one that reads it back instead. It's a speech-to-text helper, and it exists because zero-shot voice cloning has a boring prerequisite: before the model can copy a voice, it needs to know what's actually said in your reference clip. This node is how you get that text without typing it out.

It's also more useful than that sounds. Feed it any AUDIO in your graph and it hands you back a STRING transcript. That's handy on both sides of the pipeline - transcribe the clip you want to clone, and later feed the generated speech back in to check the TTS actually said what you typed. Given GLM-TTS is a Chinese-first model with a whole phoneme system for polyphones, that verification loop is less paranoid than it sounds.

How it works

Under the hood it's refreshingly simple. It takes your AUDIO, downmixes to mono, resamples to 16 kHz (the one sample rate Whisper actually wants), writes a temp WAV, and runs OpenAI's Whisper small model over it. Whisper is loaded lazily on first use - onto CUDA if you have it, CPU otherwise - and the transcript comes back as a text STRING.

The only input that matters besides audio is language, an enum with auto, zh, and en (default zh). GLM-TTS is a Chinese-native model, so zh is the safe default. Use auto if you're feeding it mixed-language clips and want Whisper to guess. The output wires straight into the Sampler's reference_text port.

Install

Install once for the whole pack via ComfyUI Manager (search "GLM-TTS" or "comfyui_GLM_TTS"), or the manual way:

cd ComfyUI/custom_nodes
git clone https://github.com/karas17/comfyui_GLM_TTS

Restart ComfyUI. The pack's requirements.txt pulls in the Chinese text-frontend stack - zhon, zhconv, jieba, pypinyin, HyperPyYAML, soundfile, scipy, huggingface_hub - and needs Python 3.10–3.12.

Here's the gotcha: openai-whisper is not in the pack's own requirements. The vendored GLM-TTS source lists it, but the node only lazy-imports it. If it's missing, the node quietly logs a warning and returns an empty string. No crash, no hint in the UI. If you want ASR (or the Sampler's auto-transcription) to actually work:

pip install openai-whisper

Common issues

  • Returns "" with no error - whisper isn't installed (fix above), or the first run is still downloading the Whisper small weights. First load takes a minute while the model fetches.
  • Wrong transcript for mixed audio - the default zh forces Chinese. Switch to auto for mixed-language clips.
  • It's slow on first use - Whisper small is a few hundred MB and has to be pulled once. Every run after is fine.

That's the whole node. It doesn't call any API, needs no key, and it's the least glamorous member of the pack - but if you've ever typed out a 10-second reference clip's script by hand, you'll reach for it.

CategoryGLM-TTS

Inputs (2)

NameTypeDefaultDescription
audioAUDIO
languageCOMBOzh3 options: auto, zh, en

Outputs (1)

NameTypeDescription
textSTRING