Nodes/ComfyUI-Google-AI-Studio/Google AI Studio Multi-Speaker TTS
ComfyUI Node

Google AI Studio Multi-Speaker TTS

Scripted conversations with Gemini TTS

By BuffMcBigHuge·Created about a year ago·Updated 6 months ago· 11
Google AI Studio Multi-Speaker TTS
    • audio
    transcriptDr. Anya: Welcome to our show! Liam: Thanks for having me, it's great to be here!
    api_key
    modelgemini-2.5-flash-preview-tts
    speaker1_nameDr. Anya
    speaker1_voiceKore (Firm)
    speaker2_nameLiam
    speaker2_voicePuck (Upbeat)
    speaker3_name
    speaker3_voiceZephyr (Bright)
    speaker4_name
    speaker4_voiceCharon (Informative)

    The annoying part of any "AI podcast" or interview video isn't writing the script - it's making two characters sound like different people. Most TTS setups make you generate each line separately and stitch them together, and the voices bleed together in a way that never quite works. This node fixes that by sending the whole conversation to Google's Gemini TTS in one call, with an explicit voice assigned to each speaker. You get a single AUDIO clip where the voices genuinely alternate.

    It's the sibling of the single-speaker Google AI Studio TTS node, with the same install, the same API key, and the same 30-voice pool. The only difference is the transcript format and the speaker mapping.

    How it works

    You write a transcript where every line starts with a speaker name and a colon:

    Dr. Anya: Welcome to our show!
    Liam: Thanks for having me, it's great to be here!
    

    The node pairs each speaker name in the transcript with a voice you assign via the speaker1_name/speaker1_voice, speaker2_name/speaker2_voice (and optional 3 and 4) fields, builds a MultiSpeakerVoiceConfig mapping, and sends the whole transcript as one generate_content call with audio modality. The returned audio is decoded into the standard ComfyUI AUDIO format - a waveform tensor plus sample rate.

    The one rule that actually matters: the names in your transcript must match the speaker name fields exactly. "Dr. Anya" in the transcript won't match "Anya" in speaker1_name. Keep them identical, or the voice mapping won't do what you expect.

    The inputs that matter

    • transcript - multiline, Name: dialogue lines. This is the whole script.
    • api_key - your Google AI Studio key.
    • model - gemini-2.5-flash-preview-tts or gemini-2.5-pro-preview-tts.
    • speaker1_name / speaker1_voice and speaker2_name / speaker2_voice - required. The voice dropdowns list all 30 voices with their style labels (Kore (Firm), Puck (Upbeat), Zephyr (Bright)…).
    • speaker3_name / speaker3_voice, speaker4_name / speaker4_voice - optional; leave the name empty to skip that speaker.

    Output is audio (AUDIO), which plugs into PreviewAudio or any ComfyUI audio save/output node.

    Installing it

    Identical to the rest of the pack. ComfyUI Manager, search "Google AI Studio," or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/BuffMcBigHuge/ComfyUI-Google-AI-Studio.git
    cd ComfyUI-Google-AI-Studio
    pip install -r requirements.txt
    

    The only dependency is google-genai>=1.66.0, and there are no model files to download. Restart ComfyUI, look under the "Google AI Studio" menu.

    Where people get burned

    Beyond the speaker-name matching trap, the usual issues are quota and context. The whole transcript goes in one request, so keep it comfortably under the 32k token window - long interviews should be split into segments and generated separately, then stitched in ComfyUI. And as with everything in this pack, it's a Google-hosted API: rate limits, no offline mode, and a strict safety filter. For a quick narrated dialogue or podcast teaser, it's shockingly little work for the result.

    CategoryGoogle AI Studio

    Inputs (11)

    NameTypeDefaultDescription
    transcriptSTRINGDr. Anya: Welcome to our show! Liam: Thanks for having me, it's great to be here!Multi-speaker transcript with speaker names followed by colons
    api_keySTRINGYour Google AI Studio API key
    modelCOMBOgemini-2.5-flash-preview-tts2 options: gemini-2.5-flash-preview-tts, gemini-2.5-pro-preview-tts
    speaker1_nameSTRINGDr. AnyaName of the first speaker
    speaker1_voiceCOMBOKore (Firm)30 options: Zephyr (Bright), Puck (Upbeat), Charon (Informative), Kore (Firm), Fenrir (Excitable), Leda (Youthful), +24
    speaker2_nameSTRINGLiamName of the second speaker
    speaker2_voiceCOMBOPuck (Upbeat)30 options: Zephyr (Bright), Puck (Upbeat), Charon (Informative), Kore (Firm), Fenrir (Excitable), Leda (Youthful), +24
    speaker3_nameoptSTRINGName of the third speaker (optional)
    speaker3_voiceoptCOMBOZephyr (Bright)30 options: Zephyr (Bright), Puck (Upbeat), Charon (Informative), Kore (Firm), Fenrir (Excitable), Leda (Youthful), +24
    speaker4_nameoptSTRINGName of the fourth speaker (optional)
    speaker4_voiceoptCOMBOCharon (Informative)30 options: Zephyr (Bright), Puck (Upbeat), Charon (Informative), Kore (Firm), Fenrir (Excitable), Leda (Youthful), +24

    Outputs (1)

    NameTypeDescription
    audioAUDIO