ComfyUI-Google-AI-Studio
Google AI Studio by BuffMcBigHuge
Nodes (7)
Free Gemini images with no GPU at all
Scripted conversations with Gemini TTS
A Gemini text node that actually behaves inside a workflow
Podcast narration without downloading a single TTS model
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.

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
styledirection 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
-
Clone this repository into your ComfyUI
custom_nodesdirectory:cd ComfyUI/custom_nodes git clone https://github.com/BuffMcBigHuge/ComfyUI-Google-AI-Studio.git -
Install the dependencies:
cd ComfyUI-Google-AI-Studio pip install -r requirements.txtgoogle-genai>=2.25.0is required for Gemini 3.8 TTS (SpeechMetadata). -
Get a Google AI Studio API key:
- Visit https://aistudio.google.com/
- Generate an API key
-
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 belowsystem_instruction(optional) — guide the model's behaviortemperature(optional) — legacy Gemini 1.x/2.x only.temperature,top_p, andtop_kare 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,highmodel_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 instructionapi_key— Google AI Studio API keymodel— see the image model table belowinput_image(optional) — reference image(s) for editing or multi-image fusionnegative_prompt(optional) — appended to the prompt asAvoid: ...aspect_ratio(optional) — supported values vary by model (see below)image_size(optional) —1K,2K,4Kmodel_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-imagesupports 1K only.gemini-2.5-flash-imagealways outputs 1K;image_sizeis 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 keymodel— a vision-capable Gemini text modelmode—Describe,Tags, orCustom promptprompt(optional) — used as-is forCustom prompt; appended as extra instructions forDescribe/Tagssystem_instruction(optional)max_output_tokens(optional) — default 2048thinking_level(optional)model_override(optional)
Output
text— description, tag list, or answer. Batched images are joined withImage 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 directionapi_key— Google AI Studio API keymodel—gemini-omni-1.2-flash(default) orgemini-omni-1.1-flashfirst_frame(optional) — starting imagelast_frame(optional) — ending image for interpolation (duration must be 3–10 s)reference_images(optional) — up to 6 images for character/object consistencyaspect_ratio—16:9(default) or9:16resolution—360p,720p(default),1080p,4kduration— 3–15 seconds, default 10task—auto(default),text_to_video,image_to_video,reference_to_video,edit,extendprevious_interaction_id(optional) — ID from an earlier run, for conversational editing or extensiondelivery—inline(default) oruri(use for videos larger than ~4 MB)frame_step— keep every Nth frame to reduce memory (default 1). WithN > 1the returned batch is effectively24/Nfps, so set the VHS frame rate to24/N.max_side— longest side of returned frames in pixels (default 1280,0keeps the original)model_override(optional)
Outputs
frames— IMAGE batch (24 fps whenframe_step=1;24/Nfps otherwise)audio— the native audio trackinteraction_id— pass this back intoprevious_interaction_idfor edits/extensions
Notes
editandextendrequire aprevious_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 keymodel—gemini-3.8-flash-tts(default) orgemini-3.8-flash-lite-ttsvoice— one of the 30 prebuilt voicesstyle(optional) — delivery direction, e.g.cheerful and friendly,whispered urgently,out of breath. Sent asspeech_metadata.stylefor Gemini 3.8, so it is not read aloud.custom_voice_id(optional) — avoice_...ID from Voice design / Voice replication; overrides the voice dropdownmodel_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 intext. - 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 inSpeaker Name: dialogueformatapi_key— Google AI Studio API keymodel— TTS modelspeaker1_name/speaker1_voice…speaker4_name/speaker4_voicestyle(optional) — applied to every turnmodel_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_keyfilter—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
- Add Google AI Studio Text Generator
- Prompt:
Write a short story about a robot learning to paint - Model:
gemini-3.8-flash - Connect the output to a text display or save node
Image generation
- Add Google AI Studio Image Generator
- Prompt:
A serene Japanese garden with cherry blossoms and a small pond - Model:
gemini-nano-banana-2.1 - Aspect ratio:
16:9, image size:2K
Image editing
- Connect an image to
input_image - Prompt:
Add a rainbow in the sky and make it look more vibrant - Model:
gemini-nano-banana-2.1
Tagging / image recognition
- Add Google AI Studio Vision
- Connect an image
- Mode:
Tags - Extra prompt:
Use lowercase Danbooru-style tags, underscore-separated, no duplicates.
Video generation
- Add Google AI Studio Omni Video
- Prompt:
A continuous unbroken shot of a paper airplane gliding through a library. Sound design: quiet room tone, distant footsteps. No dialogue. - Duration:
8, resolution:720p - Connect
framesandaudioto VHS_VideoCombine with frame rate24
TTS with style
- Add Google AI Studio TTS
- Text:
Welcome to my podcast! Today we're discussing AI. - Voice:
Kore (Firm) - Style:
warm and enthusiastic
Multi-speaker conversation
- Add Google AI Studio Multi-Speaker TTS
- Transcript:
Host: Welcome to Tech Talk! Guest: Thanks for having me on the show. Host: Let's dive into today's topic. - 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 nowgemini-3.8-flash. Removed shut-downgemini-2.0-*andgemini-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) andgemini-3.8-flash-lite-tts. - Video: added Gemini Omni 1.2 Flash.
🔄 API updates
- Image generation now uses
image_configwithaspect_ratioandimage_size; Gemini models support aspect ratio and resolution natively. - TTS uses
speech_metadata.stylefor 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.
temperatureis no longer sent to Gemini 3.6+ models (sampling parameters removed).max_output_tokensraised to 65536.thinking_levelnow usesdefaultinstead of the misleadingoff.- 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_overrideto 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_prefixinput was replaced bystyle. max_output_tokensdefault is now 4096 (includes thinking tokens).
v1.2.0 — Model Updates & Thinking Control
- Added
thinking_levelto 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.