Gemini Flash 2.0 Experimental
A Gemini API wrapper that reads your images, video and audio — no GPU required
- image
- video
- audio
- generated_content
Let's clear up the naming first, because it will trip you up. This node and its sibling GeminiFlash both display as "Gemini Flash 2.0 Experimental" and both live in the same pack - the class got renamed at some point, and comfy.icu (and a lot of old workflows, including the pack's own example files) still reference this older class name. The current code registers the node as GeminiFlash. So if you load a workflow that complains about a missing Gemini_Flash_200_Exp type, that's the rename, not a broken install - swap the node type to GeminiFlash and carry on.
What the node actually is: a thin wrapper around Google's Gemini Flash 2.0 API that lets you feed ComfyUI's local tensors straight to a cloud model. Point it at an image, a video frame sequence, or an audio clip and it returns a text answer as a STRING - perfect for image captions, scene descriptions, "what's wrong with this render" checks, or audio transcription before you prompt. It's the analysis face of the pack: no model_version or image-generation mode on this page, just multimodal understanding in, text out.
How it works
There's no local model here. The node base64-encodes your content and POSTs it to Google's generativelanguage API using the google-generativeai SDK. The details are worth knowing:
- Images get resized (long edge capped at 1024px) and sent as PNG.
- Video (an
IMAGEbatch of frames) is sampled down to about 6 evenly spaced frames, resized to 512px - it does not send the whole clip. - Audio is resampled to 16kHz and sent as a WAV.
Everything is handled client-side before the API call, so what you wire in is what gets analyzed. The node also sets Google's safety categories to "block none" at the client level, but don't read too much into that - the API still enforces its own filters server-side, and Gemini is known for aggressive censorship. A dry prompt gets you further than a spicy one.
Inputs and outputs that matter
Most of these you can leave alone. The ones you'll actually touch:
- prompt - your instruction. The default ("Analyze the situation in details.") is a fine starting point.
- input_type -
text,image,video, oraudio. This decides which optional input gets read, so set it to match. - text_input - extra context appended to the prompt for pure-text mode.
- image / video / audio - the multimodal inputs; wire from a Load Image, a VAE-decode, or an Audio Recorder node.
- api_key - the one that bites. More below.
- chat_mode / clear_history - chat keeps a rolling conversation history inside the node (stored as a
=== Chat History ===block), andclear_history: truewipes it. Handy for back-and-forth, confusing if you forget it's on.
Output is a single generated_content (STRING). Wire it into a text display node, or feed it onward as a prompt for another model - that "ask Gemini what's in this image, then build the prompt from the answer" pattern is genuinely useful.
Installing it
Install the pack via ComfyUI Manager (search "Gemini Flash") or:
cd ComfyUI/custom_nodes
git clone https://github.com/ShmuelRonen/ComfyUI-Gemini_Flash_2.0_Exp.git
Then restart ComfyUI and install the Python deps - both Gemini SDKs are required, because the analysis path uses the legacy google-generativeai and the image-generation path uses the newer google-genai:
pip install google-genai google-generativeai pillow torchaudio
Then grab a free API key from Google AI Studio and put it in the node's api_key input, or in config.json in the pack folder ({"GEMINI_API_KEY": "..."}). The node reads env var GEMINI_API_KEY first, then the input, then the config file. Paste the key into the widget - on Linux/WSL the README explicitly recommends the GUI approach over the config file, and it's the first thing to try when you get a 400 Bad Request.
Common issues
400 Bad Request- almost always the API key not actually being picked up. Enter it directly in the node'sapi_keyfield, not just inconfig.json.- Missing node type
Gemini_Flash_200_Exp- the rename, see the top of this page. - Rate limits - the free tier is roughly 10 requests/minute and 1,500/day (the pack even ships those defaults). If you're batch-scanning a folder of images you'll hit them; add a delay between calls.
This is an API node, so it runs on any machine with internet - no GPU, no model download. You're trading your hardware for a few cents of Google's, and your images leave the machine. Fine for captions and analysis; just know that's what's happening.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Analyze the situation in details. | — |
| input_type | COMBO | text | 4 options: text, image, video, audio |
| chat_mode | BOOLEAN | false | — |
| clear_history | BOOLEAN | false | — |
| text_inputopt | STRING | — | |
| imageopt | IMAGE | — | |
| videoopt | IMAGE | — | |
| audioopt | AUDIO | — | |
| api_keyopt | STRING | — | |
| proxyopt | STRING | — | |
| max_output_tokensopt | INT | 81921–8192 | — |
| temperatureopt | FLOAT | 0.40–1 | — |
| structured_outputopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| generated_content | STRING | — |