Nodes/ComfyUI-ExternalAPI-Helpers/OpenAI Text-to-Speech
ComfyUI Node

OpenAI Text-to-Speech

Simple, solid, and now steerable

By Aryan185·Created about a year ago·Updated about a month ago· 14
OpenAI Text-to-Speech
    • audio
    text
    model
    voice
    response_format
    speed1.00
    api_key
    instructions

    OpenAI's TTS API is the middle child of this pack's voice options: cheaper and faster than ElevenLabs, more conventional than Groq Orpheus, and the one with the newest trick - gpt-4o-mini-tts, which takes written instructions about how to speak, not just what to say. This node wraps all three TTS models behind one ComfyUI node and hands you back a ready AUDIO output.

    If you just need a clean narration track and don't need to nerd out over voice identity, this is a perfectly good default. The real reason to pick it over the cheaper Groq option is the instruction-following on gpt-4o-mini-tts: "speak slowly, like you're explaining to a child, slightly excited" actually changes the delivery.

    How it works

    The node calls OpenAI's audio.speech.create() with your text, model, voice, format, and speed, and decodes the returned audio bytes into a Comfy AUDIO dict (waveform + sample rate). One request, one audio clip back. The instructions field is only sent when the model supports it - the node checks and refuses to send it to tts-1/tts-1-hd, which would error server-side.

    The inputs that matter

    • text - what gets spoken.
    • model - gpt-4o-mini-tts (the steerable one, and the modern default), tts-1, or tts-1-hd (the older pair; hd is higher quality, both plain).
    • voice - nine voices: alloy, ash, coral, echo, fable, onyx, nova, sage, shimmer. They're preset personas, not cloneable. Alloy and nova are the usual favorites; the newer ash/coral are worth a listen.
    • response_format - mp3, opus, aac, flac, wav, or pcm. WAV/PCM for lossless editing, mp3 for small files, opus for the best quality-per-byte.
    • speed - 0.25 to 4.0, default 1.0. Wide range; 0.5–1.25 is the useful band.
    • instructions (optional) - only works with gpt-4o-mini-tts. Free-text direction on delivery: tone, pacing, emphasis. This is the feature that makes the node worth using.
    • api_key - OpenAI key in the field or .env (OPENAI_API_KEY).

    The output

    audio - one AUDIO output. Preview it or save it via a save-audio node (Video Helper Suite has you covered).

    Installing it

    One of ~20 nodes in the Aryan185/ComfyUI-ExternalAPI-Helpers pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Aryan185/ComfyUI-ExternalAPI-Helpers.git
    cd ComfyUI-ExternalAPI-Helpers
    pip install -r requirements.txt
    

    Restart ComfyUI; find "OpenAI Text-to-Speech" under audio/generation. The openai dependency is the one that matters. You need an OpenAI API key with billing; paste it in or set OPENAI_API_KEY in .env (copy .env.example).

    Where people get burned

    The instructions field is the trap: fill it in while running tts-1 or tts-1-hd and the node raises an error on purpose (the API doesn't support instructions there). Swap to gpt-4o-mini-tts or leave it empty. Also, these are preset voices only - there's no voice cloning, so if you need your voice or a specific one, ElevenLabs is the node for that. And it's a paid API: TTS is cheap per character but a long script still bills, so do your iteration at lower speed and mp3 before the final high-quality pass.

    For a no-fuss narration node, this is the one I'd wire up first. For expressive or cloned voices, the pack's other TTS nodes have their own strengths.

    Categoryaudio/generation

    Inputs (7)

    NameTypeDefaultDescription
    textSTRING
    modelCOMBO3 options: gpt-4o-mini-tts, tts-1, tts-1-hd
    voiceCOMBO9 options: alloy, ash, coral, echo, fable, onyx, +3
    response_formatCOMBO6 options: mp3, opus, aac, flac, wav, pcm
    speedFLOAT1.000.25–4
    api_keySTRINGDirectly put OpenAI API key or .env variable name (OPENAI_API_KEY)
    instructionsoptSTRING

    Outputs (1)

    NameTypeDescription
    audioAUDIO