Nodes/ComfyUI-Gemini_Flash_2.0_Exp/Gemini Flash 2.0 Experimental
ComfyUI Node

Gemini Flash 2.0 Experimental

A Gemini API wrapper that reads your images, video and audio — no GPU required

By ShmuelRonen·Created 2 years ago·Updated about a year ago· 337
Gemini Flash 2.0 Experimental
  • image
  • video
  • audio
  • generated_content
promptAnalyze the situation in details.
input_typetext
chat_modefalse
clear_historyfalse
text_input
api_key
proxy
max_output_tokens8192
temperature0.4
structured_outputfalse

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 IMAGE batch 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, or audio. 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), and clear_history: true wipes 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's api_key field, not just in config.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.

CategoryGemini Flash 2.0 Experimental

Inputs (13)

NameTypeDefaultDescription
promptSTRINGAnalyze the situation in details.
input_typeCOMBOtext4 options: text, image, video, audio
chat_modeBOOLEANfalse
clear_historyBOOLEANfalse
text_inputoptSTRING
imageoptIMAGE
videooptIMAGE
audiooptAUDIO
api_keyoptSTRING
proxyoptSTRING
max_output_tokensoptINT81921–8192
temperatureoptFLOAT0.40–1
structured_outputoptBOOLEANfalse

Outputs (1)

NameTypeDescription
generated_contentSTRING