Grok Text to Speech (PMS)
Put a voice line in your pipeline, tags and all
- audio
- voz_usada
Most ComfyUI users never think about audio. But if you're building narrated slideshows, character-voice demos, or anything where a video needs a voice track, this node is the missing piece: paste text, get a ComfyUI AUDIO tensor out, ready to concatenate with video frames or save to file. It's xAI's text-to-speech called over REST - no local TTS model, no heavy install, just a paid API call per line.
The fun part is the speech tags. This isn't flat narration; you can drop [laugh], [sigh], or [whisper] inline in the text and the model performs them. The default text ("Hola, soy Grok. [laugh] Me alegra hablar contigo") exists to show you that. If you've only ever used flat TTS voices, this is the first thing to play with - it's the difference between a robot reading and something with actual delivery.
The inputs that matter
- text - what gets spoken, with optional inline speech tags.
- voice - five options:
ara(neutral feminine),eve,leo,rex,sal. The tooltip callsaraneutral-feminine; the others trend masculine/characterful. - speed - 0.5 (slow) to 2.0 (fast), default 1.0.
- api_key - leave blank;
XAI_API_KEYcomes from.env.
Outputs
audio - a standard ComfyUI AUDIO tensor ({waveform, sample_rate}) that feeds audio-aware nodes directly - and voz_usada, a STRING confirming which voice rendered. If the API call fails, the node returns a silence tensor instead of crashing, so downstream video stays intact (you get silent narration and a mystery, but the graph survives).
Installing it
ComfyUI Manager, search "COMFYUI_PROMPTMODELS", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/cdanielp/COMFYUI_PROMPTMODELS
Create a .env in the pack folder:
XAI_API_KEY=xai-...
Restart. Needs ComfyUI >= 0.26.0; only requests and Pillow are required - no ffmpeg, because the node decodes the returned MP3 to a tensor itself.
What to watch for
Key hygiene, as always in this pack: keep XAI_API_KEY in .env and the node's api_key field empty - pasted keys end up in workflow JSON and PNG metadata.
And know your price model: TTS bills per character, and a long narration with a slow speed is a real bill. For cheap iteration, render one line at a time in the preview node before committing the whole script. Also note the voice list is small - five fixed voices, no custom voice cloning - so if you need a specific timbre this node isn't that; it's a fast, expressive cloud voice.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | Hola, soy Grok. [laugh] Me alegra hablar contigo. | Speech tags: [laugh] [sigh] [whisper] inline en el texto. |
| voice | COMBO | ara | ara=femenina neutra | eve | leo | rex | sal |
| speed | FLOAT | 1.00.5–2 | Velocidad del habla (0.5=lento, 2.0=rapido). |
| api_keyopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |
| voz_usada | STRING | — |