Comfyui-Kling-Wrapper TTS
Give Kling a script and a voice, get MP3s back
- audio_id
- audio_url
- duration
- audio_json
This is the speech node of the pack. Comfyui-Kling-Wrapper TTS takes some text and a voice ID, calls Kling's /v1/audio/tts endpoint, and returns a ready-to-use audio file - plus the duration and the raw response if you want them. It's the standalone version of the exact pipeline the Lip Sync Text Input node uses internally to generate narration before doing advanced lip sync. So if you want dialogue for a clip, this is the direct route.
How it works
Four required inputs, none of them surprising:
- text - the script. Capped at 1000 characters; the node raises a
text is requirederror if it's empty and a length error if you overshoot. - voice_id - the voice. This is the input that matters most and trips people up most. It has to be an official or preset voice ID on Kling's side; the node refuses to run without one.
- voice_language -
zhoren, defaultzh. - voice_speed - a float from 0.8 to 2.0, default 1.0.
The node submits the task, polls until Kling finishes, and returns four outputs: audio_id, audio_url (the file you actually use), duration, and audio_json (the full task/audio envelope if you're building something programmatic). Wire audio_url into Preview Audio or any save node and you're done.
The trap: custom voices don't work here
Here's where people get burned, and the author knows it. If you clone a voice with Custom Voice Create and feed its voice_id into this node, Kling returns Voice id not found (API error code 1201). The /v1/audio/tts endpoint simply doesn't accept custom-voice IDs yet - the pack's README calls this out explicitly.
The node actually catches that specific error and rewrites the message to tell you what to do: check that voice_language matches the voice and text, and if the ID came from Custom Voice Create, use the returned trial_url to audition the cloned voice instead, or grab an official/preset voice ID for TTS. Cloned voices are usable for video - you connect them to Image2Video.custom_voice_id with kling-v2-6 - they're just not usable for this endpoint.
Where it fits
The natural flow: generate a clip with Text2Video, write your dialogue here, then use Lip Sync with the resulting audio to make a character actually speak it. The pack ships 18_comfyui_kling_wrapper_custom_voice_tts_preview.json (custom voice creation plus trial preview) and the lip-sync-from-text example shows the TTS-to-speech chain working end to end. If your use case is narration or a voiceover track rather than synced speech, this node is enough on its own.
Installing it
Same pack, same ritual:
cd ComfyUI/custom_nodes
git clone https://github.com/magicwang1111/Comfyui-Kling-Wrapper.git
cd Comfyui-Kling-Wrapper
pip install -r requirements.txt
Or use ComfyUI Manager and search "Comfyui-Kling-Wrapper". Then create config.local.json in the repo root with your Kling API key and restart ComfyUI. No local models - this is a paid cloud call, so each render drains credits.
Common issues
- Empty
voice_id- the node raisesvoice_id is required. There's no default voice dropdown here; you must supply a real preset ID. - The 1201
Voice id not founderror - almost always a custom-voice ID fed into TTS, or avoice_languagemismatch. The node's rewritten error message walks you through it. - Long text - anything over 1000 characters gets rejected outright. Split your script into chunks and batch the nodes.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| voice_id | STRING | — | |
| voice_language | COMBO | zh | 2 options: zh, en |
| voice_speed | FLOAT | 1.00.8–2 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| audio_id | STRING | — |
| audio_url | STRING | — |
| duration | STRING | — |
| audio_json | STRING | — |