Extensions/ComfyUI-Google-AI-Studio
ComfyUI Extension

ComfyUI-Google-AI-Studio

Google AI Studio by BuffMcBigHuge

By BuffMcBigHuge·Created about a year ago·Updated 13 days ago· 11
BuffMcBigHuge/ComfyUI-Google-AI-Studio
Nodes7
On cloudLocal install
CategoryGoogle AI Studio
Stars11
Updated13 days ago
Readme

ComfyUI Google AI Studio Nodes

This custom node package integrates Google AI Studio / Gemini API into ComfyUI: text generation, Nano Banana image generation and editing, image understanding/tagging, Gemini Omni video generation, and Gemini TTS.

Updated November 2026 for the current Gemini API. Uses the google-genai SDK.

ComfyUI Google AI Studio Nodes

Features

  • Text Generation — Gemini 4 Argon, Gemini 3.8 Flash, 3.6 Flash, 3.5 Flash-Lite, 3.1 models
  • Image Generation & Editing — Nano Banana 2.1, Nano Banana 2, Nano Banana 2 Lite, Nano Banana Pro
  • Vision / Image Recognition — describe an image, generate tagging prompts, or ask a custom question
  • Video Generation & Editing — Gemini Omni 1.2 Flash with native audio, 3–15 seconds, 24 fps
  • Text-to-Speech — Gemini 3.8 Flash TTS and Flash-Lite TTS, with style direction and custom voice IDs
  • Multi-Speaker TTS — 2 speakers in one request, 3–4 speakers synthesized turn by turn
  • Model List node — query the live model catalog instead of waiting for a code update
  • Model override — every generation node accepts a free-text model ID for brand-new models
  • Batch image input — up to 14 reference images for Nano Banana, up to 6 for Omni

Installation

  1. Clone this repository into your ComfyUI custom_nodes directory:

    cd ComfyUI/custom_nodes
    git clone https://github.com/BuffMcBigHuge/ComfyUI-Google-AI-Studio.git
    
  2. Install the dependencies:

    cd ComfyUI-Google-AI-Studio
    pip install -r requirements.txt
    

    google-genai>=2.25.0 is required for Gemini 3.8 TTS (SpeechMetadata).

  3. Get a Google AI Studio API key:

  4. Restart ComfyUI.

API keys can be entered on each node, or supplied through the GOOGLE_API_KEY / GEMINI_API_KEY environment variable. Keys are passed per client and are not written to os.environ.

Nodes

Google AI Studio Text Generator

Generates text with Gemini models.

Inputs

  • prompt — the text prompt (multiline)
  • api_key — Google AI Studio API key (optional if an env var is set)
  • model — see the text model table below
  • system_instruction (optional) — guide the model's behavior
  • temperature (optional) — legacy Gemini 1.x/2.x only. temperature, top_p, and top_k are deprecated from Gemini 3.6 onward and are not sent to Gemini 3+ models.
  • max_output_tokens (optional) — 1–65536, default 4096. Includes thinking tokens.
  • thinking_level (optional) — default, low, medium, high
  • model_override (optional) — free-text model ID; overrides the dropdown

Output

  • text — generated text

Google AI Studio Image Generator

Generates and edits images with the Nano Banana family.

Inputs

  • prompt — image description or editing instruction
  • api_key — Google AI Studio API key
  • model — see the image model table below
  • input_image (optional) — reference image(s) for editing or multi-image fusion
  • negative_prompt (optional) — appended to the prompt as Avoid: ...
  • aspect_ratio (optional) — supported values vary by model (see below)
  • image_size (optional) — 1K, 2K, 4K
  • model_override (optional) — free-text model ID

Output

  • image — generated image (a batch if the model returns several images)

Notes

  • Imagen support was removed: Imagen 4 was shut down on August 17, 2026. The replacement is gemini-nano-banana-2.1.
  • gemini-3.1-flash-lite-image supports 1K only.
  • gemini-2.5-flash-image always outputs 1K; image_size is ignored for it.
  • Up to 14 reference images are supported by Nano Banana 2.1 / 2 / Pro. Nano Banana 2 Lite is not optimized for multiple references.

Google AI Studio Vision

Image recognition and tagging. This is the node requested in issue #4.

Inputs

  • image — input image (batches are processed one at a time)
  • api_key — Google AI Studio API key
  • model — a vision-capable Gemini text model
  • mode — Describe, Tags, or Custom prompt
  • prompt (optional) — used as-is for Custom prompt; appended as extra instructions for Describe / Tags
  • system_instruction (optional)
  • max_output_tokens (optional) — default 2048
  • thinking_level (optional)
  • model_override (optional)

Output

  • text — description, tag list, or answer. Batched images are joined with Image N: headers.

Tagging example: choose Tags and add:

Use lowercase Danbooru-style tags, underscore-separated, no duplicates.

Google AI Studio Omni Video

Generates and edits video with Gemini Omni Flash, including native audio.

Inputs

  • prompt — scene description, camera movement, lighting, and audio direction
  • api_key — Google AI Studio API key
  • model — gemini-omni-1.2-flash (default) or gemini-omni-1.1-flash
  • first_frame (optional) — starting image
  • last_frame (optional) — ending image for interpolation (duration must be 3–10 s)
  • reference_images (optional) — up to 6 images for character/object consistency
  • aspect_ratio — 16:9 (default) or 9:16
  • resolution — 360p, 720p (default), 1080p, 4k
  • duration — 3–15 seconds, default 10
  • task — auto (default), text_to_video, image_to_video, reference_to_video, edit, extend
  • previous_interaction_id (optional) — ID from an earlier run, for conversational editing or extension
  • delivery — inline (default) or uri (use for videos larger than ~4 MB)
  • frame_step — keep every Nth frame to reduce memory (default 1). With N > 1 the returned batch is effectively 24/N fps, so set the VHS frame rate to 24/N.
  • max_side — longest side of returned frames in pixels (default 1280, 0 keeps the original)
  • model_override (optional)

Outputs

  • frames — IMAGE batch (24 fps when frame_step=1; 24/N fps otherwise)
  • audio — the native audio track
  • interaction_id — pass this back into previous_interaction_id for edits/extensions

Notes

  • edit and extend require a previous_interaction_id.
  • First/last-frame interpolation supports 3–10 seconds; single-image and text-to-video support up to 15 seconds.
  • Omni does not support system instructions, temperature, top_p, stop sequences, or negative-prompt fields. Put negatives in the prompt ("No dialogue", "No extra sound effects").
  • English is fully supported; other languages may vary.
  • 1080p and 4k are upscaled by the API.
  • Use VHS_VideoCombine (Video Helper Suite) to assemble the returned frames and audio into an MP4.

Google AI Studio TTS

Converts text to speech with Gemini 3.8 TTS.

Inputs

  • text — the text to speak (verbatim for Gemini 3.8)
  • api_key — Google AI Studio API key
  • model — gemini-3.8-flash-tts (default) or gemini-3.8-flash-lite-tts
  • voice — one of the 30 prebuilt voices
  • style (optional) — delivery direction, e.g. cheerful and friendly, whispered urgently, out of breath. Sent as speech_metadata.style for Gemini 3.8, so it is not read aloud.
  • custom_voice_id (optional) — a voice_... ID from Voice design / Voice replication; overrides the voice dropdown
  • model_override (optional)

Output

  • audio — ComfyUI AUDIO (24 kHz)

Notes

  • Gemini 3.8 TTS returns a complete WAV file; the node handles both WAV and legacy raw PCM.
  • Inline vocal tags such as <laugh>, <sigh>, <breath>, and <short pause> can be placed directly in text.
  • Legacy preview TTS models are still selectable so old workflows load, but they shut down on November 17, 2026.

Google AI Studio Multi-Speaker TTS

Generates dialogue with multiple voices.

Inputs

  • transcript — lines in Speaker Name: dialogue format
  • api_key — Google AI Studio API key
  • model — TTS model
  • speaker1_name / speaker1_voice … speaker4_name / speaker4_voice
  • style (optional) — applied to every turn
  • model_override (optional)

Output

  • audio — combined dialogue

Notes

  • Gemini 3.8 TTS supports 2 speakers per native request. With 3–4 active speakers, the node synthesizes each turn separately and concatenates the audio with short gaps.
  • Each speaker name must match the transcript prefix exactly (case-insensitive).

Google AI Studio Model List

Lists the model IDs available to the supplied API key, one per line.

Inputs

  • api_key
  • filter — All, Text, Image, TTS, Video

Output

  • models — newline-separated model IDs

Use this when a new model ships before this package is updated, then paste the ID into any node's model_override field.

Model reference (November 2026)

Text models

| Model | Status | Notes | |-------|--------|-------| | gemini-4-argon | GA | Flagship; 1M context, 65K output, thinking low/medium/high | | gemini-3.8-flash | GA | Default; 1M context, 65K output, thinking low/medium/high | | gemini-3.6-flash | GA | Previous Flash; thinking minimal/low/medium/high | | gemini-3.5-flash-lite | GA | Fastest 3.5; default thinking minimal | | gemini-3.1-flash-lite | GA | Shutdown May 7, 2027 | | gemini-3.1-pro-preview | Preview | No shutdown date announced | | gemini-3-flash-preview | Preview | Replacement: 3.6 Flash | | gemini-2.5-flash-lite | Legacy | Not deprecated | | gemini-2.5-flash | Deprecated | Routes to 3.5 Flash-Lite on Dec 1, 2026 | | gemini-2.5-pro | Deprecated | Routes to 3.8 Flash on Dec 1, 2026 |

Image models

| Model | Status | Resolutions | Aspect ratios | |-------|--------|-------------|---------------| | gemini-nano-banana-2.1 | GA (default) | 1K, 2K, 4K | 14 (incl. 1:4, 4:1, 1:8, 8:1) | | gemini-3.1-flash-image | GA (deprecated in favor of 2.1) | 1K, 2K, 4K (API also supports 512px) | 14 | | gemini-3.1-flash-lite-image | GA | 1K only | 14 | | gemini-3-pro-image | GA | 1K, 2K, 4K | 10 (no 1:4/4:1/1:8/8:1) | | gemini-2.5-flash-image | Legacy | 1K only | 10 |

Supported aspect ratios:

  • 14: 1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9
  • 10: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9

TTS models

| Model | Status | Languages | |-------|--------|-----------| | gemini-3.8-flash-tts | GA (default) | 130+ | | gemini-3.8-flash-lite-tts | GA | 101+ | | gemini-3.1-flash-tts-preview | Shuts down Nov 17, 2026 | — | | gemini-2.5-flash-preview-tts | Shuts down Nov 17, 2026 | — | | gemini-2.5-pro-preview-tts | Shuts down Nov 17, 2026 | — |

Video models

| Model | Status | Notes | |-------|--------|-------| | gemini-omni-1.2-flash | GA (default) | 3–15 s, 360p/720p/1080p/4k, native audio, 24 fps | | gemini-omni-1.1-flash | Transition | Routes to 1.2 on Dec 3, 2026 |

Available Voices

The 30 prebuilt studio voices:

| Voice | Style | Voice | Style | Voice | Style | |-------|--------|-------|--------|-------|--------| | Zephyr | Bright | Puck | Upbeat | Charon | Informative | | Kore | Firm | Fenrir | Excitable | Leda | Youthful | | Orus | Firm | Aoede | Breezy | Callirrhoe | Easy-going | | Autonoe | Bright | Enceladus | Breathy | Iapetus | Clear | | Umbriel | Easy-going | Algieba | Smooth | Despina | Smooth | | Erinome | Clear | Algenib | Gravelly | Rasalgethi | Informative | | Laomedeia | Upbeat | Achernar | Soft | Alnilam | Firm | | Schedar | Even | Gacrux | Mature | Pulcherrima | Forward | | Achird | Friendly | Zubenelgenubi | Casual | Vindemiatrix | Gentle | | Sadachbia | Lively | Sadaltager | Knowledgeable | Sulafat | Warm |

Gemini 3.8 TTS also supports the Extended Voice Library (hundreds of voices), Voice design, Voice replication, and Voice remixing. Paste a voice_... ID into custom_voice_id to use a custom voice.

Usage Examples

Text generation

  1. Add Google AI Studio Text Generator
  2. Prompt: Write a short story about a robot learning to paint
  3. Model: gemini-3.8-flash
  4. Connect the output to a text display or save node

Image generation

  1. Add Google AI Studio Image Generator
  2. Prompt: A serene Japanese garden with cherry blossoms and a small pond
  3. Model: gemini-nano-banana-2.1
  4. Aspect ratio: 16:9, image size: 2K

Image editing

  1. Connect an image to input_image
  2. Prompt: Add a rainbow in the sky and make it look more vibrant
  3. Model: gemini-nano-banana-2.1

Tagging / image recognition

  1. Add Google AI Studio Vision
  2. Connect an image
  3. Mode: Tags
  4. Extra prompt: Use lowercase Danbooru-style tags, underscore-separated, no duplicates.

Video generation

  1. Add Google AI Studio Omni Video
  2. Prompt: A continuous unbroken shot of a paper airplane gliding through a library. Sound design: quiet room tone, distant footsteps. No dialogue.
  3. Duration: 8, resolution: 720p
  4. Connect frames and audio to VHS_VideoCombine with frame rate 24

TTS with style

  1. Add Google AI Studio TTS
  2. Text: Welcome to my podcast! Today we're discussing AI.
  3. Voice: Kore (Firm)
  4. Style: warm and enthusiastic

Multi-speaker conversation

  1. Add Google AI Studio Multi-Speaker TTS
  2. Transcript:
    Host: Welcome to Tech Talk!
    Guest: Thanks for having me on the show.
    Host: Let's dive into today's topic.
    
  3. Speaker 1: Host / Kore; Speaker 2: Guest / Puck

Technical Details

  • TTS audio: 24 kHz, mono, 16-bit PCM; Gemini 3.8 returns WAV on unary requests
  • Video: 24 fps; native audio; 3–15 seconds; 16:9 or 9:16
  • Text context: up to 1M tokens on Gemini 3.8 Flash / 4 Argon
  • Image output: 1K = 1024px class, 2K = 2048px class, 4K = 4096px class (varies by aspect ratio)
  • API rate limits: subject to your Google AI Studio tier

Troubleshooting

503 UNAVAILABLE — "model is currently experiencing high demand"

A transient Google-side error. Re-queue the workflow or try again in a minute. Trying a different model (e.g. gemini-3.6-flash) also works.

429 RESOURCE_EXHAUSTED

You hit a quota or rate limit. Check your plan and limits at https://ai.dev/rate-limit. Some models (notably Nano Banana 2.1) have no free-tier quota.

module 'google.genai.types' has no attribute 'SpeechMetadata'

Your SDK is too old for Gemini 3.8 TTS. Upgrade:

pip install --upgrade "google-genai>=2.25.0"

temperature has no effect

Sampling parameters are deprecated from Gemini 3.6 onward. The node only sends temperature to Gemini 1.x/2.x models. Use a system instruction for deterministic behavior instead.

Imagen models are gone

Imagen 4 was shut down on August 17, 2026. Use gemini-nano-banana-2.1 instead.

Old workflows show a missing model

Models that were shut down (Imagen, Gemini 2.0, TTS previews) are either removed or kept only for compatibility. Use Google AI Studio Model List to find the current ID, then paste it into model_override.

Support

License

MIT License — see LICENSE.

Changelog

v1.3.0 — November 2026 model refresh

🆕 New nodes

  • Google AI Studio Vision — image description, tagging prompts, and custom questions (issue #4)
  • Google AI Studio Omni Video — Gemini Omni 1.2 Flash video generation/editing with native audio, first/last-frame interpolation, reference images, and interaction IDs for follow-up edits
  • Google AI Studio Model List — query the live model catalog (issue #3)

🔄 Model updates

  • Text: added gemini-4-argon, gemini-3.8-flash, gemini-3.6-flash, gemini-3.5-flash-lite, gemini-3.1-flash-lite. Default is now gemini-3.8-flash. Removed shut-down gemini-2.0-* and gemini-3-pro-preview.
  • Image: added gemini-nano-banana-2.1 (default), gemini-3.1-flash-image, gemini-3.1-flash-lite-image, gemini-3-pro-image. Removed shut-down Imagen 4 models and the Imagen-only code path.
  • TTS: added gemini-3.8-flash-tts (default) and gemini-3.8-flash-lite-tts.
  • Video: added Gemini Omni 1.2 Flash.

🔄 API updates

  • Image generation now uses image_config with aspect_ratio and image_size; Gemini models support aspect ratio and resolution natively.
  • TTS uses speech_metadata.style for Gemini 3.8 (style is no longer read aloud) and handles WAV output.
  • Multi-speaker TTS uses native 2-speaker requests and per-turn synthesis for 3–4 speakers.
  • temperature is no longer sent to Gemini 3.6+ models (sampling parameters removed).
  • max_output_tokens raised to 65536.
  • thinking_level now uses default instead of the misleading off.
  • API keys are passed per client instead of mutating os.environ.
  • Automatic function calling is disabled (no extra round trips or warnings).
  • Video requests use a 15-minute timeout and bypass the SDK's automatic retry, so a 429 quota error fails immediately instead of hanging the queue for hours.
  • Added model_override to every generation node for brand-new model IDs.
  • Added clear error messages for blocked prompts, quota errors, and missing images/audio.

⚠️ Breaking changes

  • Imagen models and the Imagen-only inputs (safety_filter_level, person_generation) were removed.
  • The TTS instruction_prefix input was replaced by style.
  • max_output_tokens default is now 4096 (includes thinking tokens).

v1.2.0 — Model Updates & Thinking Control

  • Added thinking_level to the Text Generator.
  • Added Gemini 3.1 / 3 models and Nano Banana 2 / Pro image models.

v1.1.0 — Image Editing & Batch Processing

  • Added Gemini image editing with multimodal input and batch support.
  • Added Gemini 3 and Imagen 4 models.

Note: This is an unofficial community integration. Google AI Studio and Gemini are products of Google LLC.