Nodes/ComfyUI-Gemini_TTS/πŸŽ™οΈ Gemini Text-to-Speech
ComfyUI Node

πŸŽ™οΈ Gemini Text-to-Speech

Turn text into real Gemini voices inside ComfyUI β€” no model download, just an API key

By ShmuelRonenΒ·Created about a year agoΒ·Updated about a year agoΒ· 22
πŸŽ™οΈ Gemini Text-to-Speech
    • audio
    • status
    β—„promptSay: Hello, this is a test of Gemini text-to-speech.β–Ί
    β—„tts_modelgemini-2.5-pro-preview-ttsβ–Ί
    β—„voice[M] Puckβ–Ί
    β—„temperature1.0β–Ί
    β—„api_keyβ–Ί
    β—„auto_fallback_to_flashtrueβ–Ί
    β—„retry_delay30β–Ί
    β—„use_paid_tierfalseβ–Ί
    β—„billing_project_idβ–Ί
    β—„aggressive_retryfalseβ–Ί
    β—„show_voice_infofalseβ–Ί

    If you've ever built a ComfyUI workflow and wished the video or image it produced could talk, this is the node you're missing. πŸŽ™οΈ Gemini Text-to-Speech (class GeminiTTS, from ShmuelRonen's ComfyUI-Gemini_TTS pack) turns a plain text prompt into actual spoken audio using Google's Gemini 2.5 TTS models - 30 voices, free tier to start, no GPU work on your side. It's the same author behind the popular ComfyUI_wav2lip nodes, so this is someone who ships audio-adjacent ComfyUI stuff people actually use.

    The name might make you brace for a huge local model download. There isn't one. This is an API node: it sends your text to Google's servers, gets audio back, and hands it to ComfyUI as a standard AUDIO output you can wire into anything that accepts audio - a video pipeline for lip-sync, a save-audio node, whatever your workflow already has.

    How it actually works

    Under the hood it makes a plain REST call to generativelanguage.googleapis.com/v1beta/models/{model}:generateContent, asking for responseModalities: ["AUDIO"] with a speechConfig that names your chosen voice. Google returns base64-encoded 16-bit PCM audio, the node decodes it, normalizes it to float32, wraps it in a {"waveform": tensor, "sample_rate": 24000} dict, and that's your audio output. No google-generativeai needed for the main path - that library is only used in the fallback mode.

    Two models are on offer: gemini-2.5-pro-preview-tts (default, nicer quality, slower) and gemini-2.5-flash-preview-tts (faster, still good). The 30 voices are prebuilt Google ones - Puck (default, upbeat), Charon, Fenrir, Aoede, Zephyr and friends - with male/female prefixes in the dropdown so you don't have to guess.

    The inputs that matter

    • prompt - your text. A Say: prefix is supported (the classic Gemini TTS convention) but plain text works too. Default is a test phrase so you can smoke-test without thinking.
    • tts_model - Pro vs Flash, as above. Start with Flash for iterating; it's cheaper and snappier.
    • voice - pick from the 30. There's no wrong answer, but Puck is the safe default.
    • temperature - 0.0–2.0, default 1.0. Higher = more expressive/creative delivery, lower = flatter and more consistent. For narration, people tend to land around 1.0–1.5.

    Everything else is optional. api_key is the quick-and-dirty way in (the node saves it to a config.json next to itself, which is handy and also a reason to keep that file out of git). auto_fallback_to_flash (default on) automatically retries on Flash when Pro hits a rate limit - leave it on. use_paid_tier + billing_project_id are for production: they bump your quotas and attach billing, at roughly $0.01–0.02 per typical request on Pro. retry_delay, aggressive_retry, and show_voice_info are niceties you'll probably never touch.

    It returns two outputs: audio (the speech) and status (a string with what happened - which model, which voice, and any warnings). Wire the status into a text display node if you want to see why you got silence instead of speech; it's genuinely useful.

    Installing it

    Easiest via ComfyUI Manager - search "Gemini TTS" (pack title: ShmuelRonen/ComfyUI-Gemini_TTS) and install. Or the manual route:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/ShmuelRonen/ComfyUI-Gemini_TTS.git
    

    then restart ComfyUI. Dependencies are light - the shipped requirements.txt only wants google-generativeai and requests; torch, torchaudio and numpy are already in your ComfyUI environment. Then grab a free key from AI Studio (starts with AIza, ~39 chars) and either set GEMINI_API_KEY in your environment or paste it into the node. That's the whole setup. No model files, no VRAM, nothing.

    Where people get burned

    Most failures come from the key, not the node. If status says the key is invalid, check it starts with AIza and is ~39 characters - pasting in a Cloud project ID or a truncated key is the classic mistake. The free tier rate-limits hard; hit a 429 and either wait ~60 seconds, switch to Flash, or flip on paid tier.

    And here's the trap worth knowing: when both models are rate-limited, the node drops into "simulation mode" - it asks Gemini for voice-acting instructions and returns a placeholder tone that's effectively silent, not speech. It does this to keep the workflow from hard-crashing, which is polite, but if your output is a quiet 440 Hz hum and your status mentions "Simulation Mode," that's not a bug - your quota is spent and the audio is a stub. Check the status string before you rebuild your whole workflow around a silent result.

    CategoryGemini TTS

    Inputs (11)

    NameTypeDefaultDescription
    promptSTRINGSay: Hello, this is a test of Gemini text-to-speech.β€”
    tts_modelCOMBOgemini-2.5-pro-preview-tts2 options: gemini-2.5-pro-preview-tts, gemini-2.5-flash-preview-tts
    voiceCOMBO[M] Puck30 options: [F] Aoede, [F] Kore, [F] Leda, [F] Zephyr, [F] Autonoe, [F] Callirhoe, +24
    temperatureFLOAT1.00–2β€”
    api_keyoptSTRINGβ€”
    auto_fallback_to_flashoptBOOLEANtrueβ€”
    retry_delayoptINT3010–120β€”
    use_paid_tieroptBOOLEANfalseβ€”
    billing_project_idoptSTRINGβ€”
    aggressive_retryoptBOOLEANfalseβ€”
    show_voice_infooptBOOLEANfalseβ€”

    Outputs (2)

    NameTypeDescription
    audioAUDIOβ€”
    statusSTRINGβ€”