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

Gemini Flash 2.0 Experimental

Text, image, video, audio and image generation — one node, one API key

By ShmuelRonen·Created 2 years ago·Updated about a year ago· 337
Gemini Flash 2.0 Experimental
  • images
  • video
  • audio
  • generated_content
  • generated_images
promptAnalyze the situation in details.
input_typetext
model_versiongemini-2.0-flash-exp
operation_modeanalysis
chat_modefalse
clear_historyfalse
Additional_Context
api_key
max_output_tokens8192
temperature0.4
structured_outputfalse
max_images6
batch_count1
seed0

This is the current, feature-complete version of the pack's main node - the one the code actually exports, and the one you'll find in most workflows built after the pack's rename from Gemini_Flash_200_Exp. What it adds over its analysis-only sibling is a model_version dropdown and an operation_mode switch, which unlock Google's experimental image generation model. So in one node you can either get text answers about an image, video, or audio clip, or have Gemini generate images straight back into your graph as a tensor. No GPU needed for either - it's all cloud.

How it works

The node runs two different SDKs under the hood. The analysis path uses the legacy google-generativeai package: your content is base64-encoded (images resized to 1024px, video sampled to ~6 frames at 512px, audio resampled to 16kHz WAV) and sent to the gemini-2.0-flash-exp model. The image-generation path switches to the newer google-genai SDK and sets response_modalities=['Text', 'Image'] so the model returns inline images, which the node decodes back into ComfyUI's IMAGE format.

Those "exp" model names matter. This pack was built in the spring of 2025, when gemini-2.0-flash-exp and gemini-2.0-flash-exp-image-generation were the hot experimental names. Google's image models were rebranded into the "Nano Banana" lineup (Gemini 2.5 Flash Image) and the old experimental strings get retired. If you start getting model-not-found or validation errors, the model string is the first suspect - update it or find a pack version that tracks the current names.

Inputs and outputs that matter

Required inputs are the ones you'd expect, plus two that define the mode:

  • model_version - gemini-2.0-flash-exp, the thinking variant, or the image-generation model. Pick the image-gen one for generate_images.
  • operation_mode - analysis or generate_images. This is the big switch.
  • prompt and input_type (text / image / video / audio) work like the analysis sibling.
  • images - a multi-image input (IMAGE, list-friendly) used both for analysis and as reference images in generation mode; max_images caps how many get sent (default 6, up to 16).
  • batch_count - how many images to generate (1–4) in generation mode.
  • seed - looks like a reproducibility control, but here's the dirty secret: the code increments it and never actually passes it to the API. It's decorative. If you were hoping for seed-locked reruns, this isn't it.
  • temperature (0.4) and max_output_tokens (8192) - the usual sampling knobs.

Outputs are generated_content (STRING) and generated_images (IMAGE). In analysis mode the image output is just a gray placeholder; in generation mode it's the real tensor, ready to wire into a VAE/preview or any downstream node.

Installing it

Same as every node in this pack - ComfyUI Manager (search "Gemini Flash") or:

cd ComfyUI/custom_nodes
git clone https://github.com/ShmuelRonen/ComfyUI-Gemini_Flash_2.0_Exp.git

Then the deps. Both SDKs are genuinely required - analysis needs google-generativeai, image gen needs google-genai:

pip install google-genai google-generativeai pillow torchaudio

Get a free key from Google AI Studio and either paste it into the node's api_key field (recommended on Linux/WSL) or set it in the pack's config.json. Free-tier limits are roughly 10 requests/minute and 1,500/day.

Common issues

  • Blank or gray output image - this is the classic. The node returns a solid 512×512 gray placeholder whenever the generation call fails, and people post about getting "a blank gray area" from Gemini-in-ComfyUI setups all the time. That gray block isn't the model doing nothing - it's the failure fallback. Check the console: a 400 Bad Request almost always means the API key didn't get picked up.
  • "Value not in list" for the model - the exact model string you selected doesn't exist for your key/region anymore. Pick another entry or type in the current name.
  • Rate limits - the free tier fills up fast if you're running batch_count: 4 repeatedly.

Gemini's image generation is genuinely good at text rendering and iterating on reference images, but it's censored in ways local checkpoints aren't - the community has spent a lot of time complaining about that exact trade-off. For one-off images and style-transfer experiments it's fun; for a production pipeline you'll want to keep your local models warm.

CategoryGemini Flash 2.0 Experimental

Inputs (17)

NameTypeDefaultDescription
promptSTRINGAnalyze the situation in details.
input_typeCOMBOtext4 options: text, image, video, audio
model_versionCOMBOgemini-2.0-flash-exp3 options: gemini-2.0-flash-exp, gemini-2.0-flash-thinking-exp-1219, gemini-2.0-flash-exp-image-generation
operation_modeCOMBOanalysis2 options: analysis, generate_images
chat_modeBOOLEANfalse
clear_historyBOOLEANfalse
Additional_ContextoptSTRING
imagesoptIMAGE
videooptIMAGE
audiooptAUDIO
api_keyoptSTRING
max_output_tokensoptINT81921–8192
temperatureoptFLOAT0.40–1
structured_outputoptBOOLEANfalse
max_imagesoptINT61–16
batch_countoptINT11–4
seedoptINT0

Outputs (2)

NameTypeDescription
generated_contentSTRING
generated_imagesIMAGE