Nodes/PromptModels Studio/Grok Text to Speech (PMS)
ComfyUI Node

Grok Text to Speech (PMS)

Put a voice line in your pipeline, tags and all

By cdanielp·Created 9 months ago·Updated 2 months ago· 28
Grok Text to Speech (PMS)
    • audio
    • voz_usada
    textHola, soy Grok. [laugh] Me alegra hablar contigo.
    voiceara
    speed1.0
    api_key

    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 calls ara neutral-feminine; the others trend masculine/characterful.
    • speed - 0.5 (slow) to 2.0 (fast), default 1.0.
    • api_key - leave blank; XAI_API_KEY comes 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.

    CategoryPromptModels/Grok

    Inputs (4)

    NameTypeDefaultDescription
    textSTRINGHola, soy Grok. [laugh] Me alegra hablar contigo.Speech tags: [laugh] [sigh] [whisper] inline en el texto.
    voiceCOMBOaraara=femenina neutra | eve | leo | rex | sal
    speedFLOAT1.00.5–2Velocidad del habla (0.5=lento, 2.0=rapido).
    api_keyoptSTRING

    Outputs (2)

    NameTypeDescription
    audioAUDIO
    voz_usadaSTRING