Gemini Text-to-Speech
Gemini TTS that sounds like a human, not a robot
- audio
Text-to-speech in ComfyUI usually means a local model - Kokoro for tiny-and-fast, Chatterbox for quality - and those are genuinely good now. So why would you call Gemini's API for the same job? Because this is the "make a video clip actually talk" node, and Gemini's TTS voices land somewhere between ElevenLabs-class naturalness and the zero-setup convenience of a hosted call. Thirty prebuilt voices (Zephyr, Puck, Kore, Fenrir, and friends), three models, no voice files to manage, no VRAM. Paste text, get audio.
The KB's audio-generation.md frames it honestly: local open TTS is competitive, and for cloning your own voice, local is now the privacy-preserving default. But for grabbing a polished, expressive narrator voice for a video render without installing anything, this node is the fastest on-ramp in the pack. It also does something neat that local TTS usually needs extra tooling for: multi-speaker dialogue by typing speaker tags right in the text.
How it works
Gemini TTS runs through the same generate_content endpoint as the text nodes, but with the response modality set to audio and a speech_config carrying your chosen voice. The text goes in, and instead of tokens you get back a raw audio blob - specifically 24 kHz signed 16-bit PCM, which the node converts into a standard ComfyUI AUDIO dict. The style_prompt input is prepended to your text ("Say cheerfully: …") to steer emotion and pacing without changing the content.
Inputs and outputs that matter
text- what to say. The multi-speaker trick: use speaker tags likeAlice: Hi there. Bob: Hello!and the model assigns voices to each speaker. That's real capability for dialogue scenes.voice- 30 prebuilt names. Each has a character; Kore and Fenrir are the defaults people tend to land on. Try a few - they're noticeably distinct.model- three TTS models:gemini-2.5-flash-preview-tts(default, fast),gemini-2.5-pro-preview-tts(higher quality), and the newergemini-3.1-flash-tts-preview.style_prompt- the emotion dial. "Say it slowly and somberly:" changes the delivery.
One output: audio (AUDIO), ready for a save/preview node or to pair with a lip-synced video.
How to install it
Pack-level install:
cd ComfyUI/custom_nodes
git clone https://github.com/IxMxAMAR/ComfyUI-API-Toolkit
cd ComfyUI-API-Toolkit
pip install -r requirements.txt
or "API Toolkit" in ComfyUI Manager. Needs google-genai>=0.8.0 and a Gemini API key. Nothing to download - voices are server-side.
Common issues
The failure you'll hit first is "Gemini TTS returned no audio data," which is the node's way of saying the call came back without audio - usually a prompt that got filtered or a model ID that's rotated out (the TTS previews change; check the pack's List Models node and use custom_model if needed).
Beyond that, manage expectations: Gemini voices are great but they are what they are - you can't clone a specific voice with this node, so if you need your voice, that's a job for local cloning or ElevenLabs. And every queue is a paid call (the pack's API nodes always re-execute), so a long narration is one request, but re-Queueing to tweak one line bills the whole clip again. Keep the text tight while you iterate.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | Gemini API key. Leave blank to use GEMINI_API_KEY env var. | |
| model | COMBO | gemini-2.5-flash-preview-tts | TTS model. Pro = higher quality, Flash = faster. |
| text | STRING | Text to speak. Can include speaker tags for multi-speaker dialogue. | |
| voice | COMBO | Kore | Prebuilt voice. Each has different characteristics. |
| custom_modelopt | STRING | — | |
| style_promptopt | STRING | Optional style instruction prepended to text (e.g., 'Say cheerfully:'). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |