Nodes/ERPK Collection/Gemini Image Generation
ComfyUI Node

Gemini Image Generation

Nano Banana power, right in ComfyUI

By eRepublik-Labs·Created 11 months ago·Updated 20 days ago· 1
Gemini Image Generation
  • client
  • image
  • description
prompt
seed-1
modelgemini-3.1-flash-image
temperature1.0
aspect_ratiodefault
image_sizedefault
response_modalitiesIMAGE
enable_google_searchfalse

If you've heard of Gemini's image models, you've heard them called "Nano Banana." This node is the API access to that family: pick a model (default gemini-3.1-flash-image), write a prompt, and get back a real IMAGE tensor plus a text description - no hugging a GPU required. The strengths here are things local SD struggles with: reliable text rendering in images, up to 4K output, and 14 aspect ratios to pick from.

The node talks to the Gemini API directly (via google-genai), runs the image job, converts the result to a ComfyUI tensor, and hands it on. Because each model is a dropdown on the node itself, you don't need a separate model selector - the client (from Gemini API Config, or the Settings key) is just authentication.

Inputs that matter

  • prompt - the image description. Multiline.
  • model - gemini-3.1-flash-image default; also 3 Pro (the flagship, "Nano Banana Pro" class - 4K native, thinking mode) and 2.5 Flash (the original Nano Banana, fixed 1024px).
  • aspect_ratio - default or one of 14 ratios on 3.1 Flash (10 on 3 Pro and 2.5 Flash). This is the nicest part of the node - no manual pixel math.
  • image_size - default, 1K–4K on the 3.x models; ignored on 2.5 Flash (fixed 1024).
  • temperature - 1.0 default, 0–2. Higher = more creative/looser.
  • response_modalities - IMAGE (default) or both image and a text description. The second option fills the description output with the model's own caption of what it made.
  • enable_google_search - off. Grounds generation with Google Search results; Gemini 3.x models only, silently unavailable on 2.5 Flash.
  • seed - reproducibility/cache, -1 randomizes.

Outputs: image (IMAGE tensor) and description (STRING, filled when response_modalities includes text).

Install and gotchas

Part of the ERPK Collection:

cd ComfyUI/custom_nodes
git clone https://github.com/eRepublik-Labs/comfyui-nodes-erpk.git erpk
cd erpk && pip install -r requirements.txt

Restart (or ComfyUI Manager → search erpk), then a Google AI Studio API key under Settings > ERPK > API Keys. Paid per image, tiered by resolution - 4K on Pro is the spendy end, Flash 1K is cheap. And every image carries Google's invisible SynthID watermark, so don't plan on selling unmarked generations.

The trap: reading the image_size as a universal knob and wondering why 2.5 Flash ignores it - that model is hard-fixed at 1024, use 3.1 Flash or 3 Pro for resolution control. And if a prompt's output feels underbaked, check whether enable_google_search is on when you don't want it - grounding changes behavior, not just facts.

CategoryERPK/Gemini

Inputs (9)

NameTypeDefaultDescription
promptSTRINGDescription of the image to generate
seedINT-1-1–2147483647Seed for reproducible outputs. Randomizes by default.
clientoptGEMINI_API_CLIENTGemini API client from Gemini API Config node (uses API key from config)
modeloptCOMBOgemini-3.1-flash-imageImage generation model (overrides client model)
temperatureoptFLOAT1.00–2Creativity level (higher = more creative)
aspect_ratiooptCOMBOdefaultImage aspect ratio (all 14 ratios for 3.1 Flash; 10 for 3 Pro and 2.5 Flash)
image_sizeoptCOMBOdefaultImage resolution (1K-4K for 3.1 Flash and 3 Pro; 2.5 Flash fixed at 1024px)
response_modalitiesoptCOMBOIMAGEWhat to return - image only or both text description and image
enable_google_searchoptBOOLEANfalseEnable Google Search grounding (Gemini 3 models only, not 2.5 Flash)

Outputs (2)

NameTypeDescription
imageIMAGE
descriptionSTRING