TTS WebUI via API
The raw TTS node that talks to any model in your TTS WebUI server
- audio
- wav_path
- metadata_json
If you only install one node from this pack, make it this one. "TTS WebUI via API" is the generic jack-of-all-trades: a raw OpenAI-style client that can drive any model your TTS WebUI server has loaded, with no dedicated node required. When a new TTS model lands in the server before this pack adds a wrapper for it, this is the node you reach for.
The naming is the trap
Despite the "OpenAI-style" framing, this thing calls no external API and needs no OpenAI key. It POSTs a JSON body to your own local server at http://127.0.0.1:7778/v1/audio/speech and converts the WAV that comes back into a ComfyUI AUDIO object - a torch waveform tensor plus sample rate - so you can wire it straight into an audio preview or save node.
The actual model, the GPU work, and the weights all live in that server (the sibling project rsxdalv/TTS-WebUI, same author). This node is the remote control, not the engine. The upside: ComfyUI stays light, the heavy Python/transformers dependencies stay out of your ComfyUI env, and you can drive a server on another machine over your LAN.
The inputs that matter
- text - what you want spoken. The obvious one.
- model - a string naming whatever model the server exposes (defaults to
kokoro). - voice - defaults to
random, which is exactly what it sounds like. Put a named voice here if the server has one you like. - speed - 0.25 to 4.0.
- params_json - a JSON object passed through to the server as model params, e.g.
{"temperature": 0.7}.
The killer feature is advanced_request_json. Put a full JSON body in it and the node sends it verbatim, overriding everything else. That's your escape hatch for model options that don't have dedicated fields, and it's great for poking the API by hand when a server-side model needs a parameter nobody thought to expose.
Outputs
You get three: audio (AUDIO, the thing you wire into playback/save), wav_path (STRING, empty unless you tick also_save_wav, which writes to ComfyUI's output/audio folder), and metadata_json (STRING with the request model, api_base, status code, and - when saved - sample rate and duration).
Installing it
ComfyUI Manager → search "TTS WebUI API nodes for ComfyUI", or:
cd ComfyUI/custom_nodes
git clone https://github.com/rsxdalv/ComfyUI-TTS-Webui
then restart ComfyUI. Dependencies are just requests, numpy, torch - all already in any ComfyUI environment, so there's no separate pip step and the node downloads nothing. Models live in the server.
When it breaks
- Connection refused: the TTS WebUI server isn't running on
127.0.0.1:7778. Start it and load a model there first. If the server is elsewhere, pointapi_baseat it - the node appends/v1/audio/speechitself. - First request stalls past the timeout: the server is loading or downloading the model on first use. Bump
timeout_sec(max 600). - Model/voice 4xx: you asked for something the server doesn't have loaded. Check the server's model and voice lists.
- API key: only if your server demands one - either the
api_keyinput, theTTS_WEBUI_OPENAI_API_KEYenv var, or atts_api_key.txtfile sitting next to the pack folder. Fun leftover: the README still mentionsSAI_API_KEYbackward-compat from this repo's earlier life as a Stability API template, but the shipped code only reads the TTS env var and the key file.
One last thing: channels_first defaults to True, meaning the waveform comes back as (C, N). It only matters if a downstream audio node is picky about channel order - leave it alone unless you're getting weird mono/stereo behaviour.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | Hello from ComfyUI | — |
| api_base | STRING | http://127.0.0.1:7778 | — |
| model | STRING | kokoro | — |
| voice | STRING | random | — |
| speed | FLOAT | 1.000.25–4 | — |
| params_json | STRING | {} | — |
| api_keyopt | STRING | — | |
| timeout_secopt | INT | 1201–600 | — |
| channels_firstopt | BOOLEAN | true | — |
| also_save_wavopt | BOOLEAN | false | — |
| save_prefixopt | STRING | tts | — |
| return_metadataopt | BOOLEAN | true | — |
| advanced_request_jsonopt | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |
| wav_path | STRING | — |
| metadata_json | STRING | — |