Generate Speech (AI CustomURL)
Turn a text wire into an AUDIO output with one hosted TTS call
- audio
- file_path
Somewhere between "image" and "video" there's a third thing ComfyUI workflows keep wanting: a voiceover. This node gives you one with a single API call - it posts your text to POST /audio/speech on an OpenAI-compatible endpoint (tts-1 by default) and returns a proper AUDIO output plus the path to the saved file. So you can chain text generation → speech → video in one graph and end up with a narrated clip, no local TTS model eating your VRAM.
How it works
The mechanism is refreshingly simple. It sends model, input (your text), voice, and speed to the endpoint, gets raw audio bytes back, writes them to a temp file with the right extension, and then loads them through torchaudio into ComfyUI's AUDIO structure - a {waveform, sample_rate} dict. The file_path output gives you the on-disk location if you'd rather grab the file directly.
There's a graceful fallback worth knowing: if torchaudio can't decode the format for any reason, the node doesn't hard-fail - it returns the string audio_bytes_saved in the audio slot plus the valid file path, so the bytes are still on disk for you to use elsewhere.
The inputs that matter
base_url+api_key+model- the standard pack trio.tts-1on OpenAI;tts-kokoroif you're pointed at Venice.input- the text to speak. It's the multiline field, so paste freely.voice- OpenAI voices arealloy,echo,fable,onyx,nova,shimmer. It's a free-text string, so compatible providers accept their own names.response_format-mp3(default),opus,aac,flac,wav,pcm. Pickwavif you're feeding the audio into processing that doesn't want lossy compression.speed- 0.25× to 4×. 1.0 is normal.
The optional advanced_params_json merges extra fields into the request - that's where the Speech Advanced Parameters node plugs in.
Installing it
ComfyUI Manager → search "AI CustomURL" → Install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/bowtiedbluefin/ComfyUI-AI-CustomURL
cd ComfyUI-AI-CustomURL
pip install -r requirements.txt
API-only, no model downloads. Dependencies are requests, aiohttp, pillow, numpy, torch, torchaudio, and opencv-python - and yes, torchaudio is the one that actually earns its place here.
Common issues and the honest caveats
- The advanced speech params do nothing on OpenAI.
pitch,stability,emotionare ElevenLabs-style parameters thattts-1's endpoint doesn't accept. They only matter on compatible providers that support them - the README's Venicetts-kokoroexample is the kind of endpoint that might. - Format mismatch on the AUDIO output. Not every downstream audio node expects the same sample rate or channel layout; if your consumer node complains, check the
sample_ratethe dict carries. - Same auth/typo failures as everywhere - 401 on a wrong key, "model not found" on a wrong name.
Like the rest of this pack it's a small single-author project with almost no community footprint as of writing. For a quick, dependency-free way to add narration to a ComfyUI video pipeline, it does the job cleanly.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| base_url | STRING | https://api.openai.com/v1 | — |
| api_key | STRING | — | |
| model | STRING | tts-1 | — |
| input | STRING | — | |
| voice | STRING | alloy | — |
| response_format | COMBO | mp3 | 6 options: mp3, opus, aac, flac, wav, pcm |
| speed | FLOAT | 1.000.25–4 | — |
| advanced_params_jsonopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |
| file_path | STRING | — |