Gemini Image Generation
Nano Banana power, right in ComfyUI
- client
- image
- description
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-imagedefault; also3 Pro(the flagship, "Nano Banana Pro" class - 4K native, thinking mode) and2.5 Flash(the original Nano Banana, fixed 1024px). - aspect_ratio -
defaultor 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 thedescriptionoutput 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.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Description of the image to generate | |
| seed | INT | -1-1–2147483647 | Seed for reproducible outputs. Randomizes by default. |
| clientopt | GEMINI_API_CLIENT | Gemini API client from Gemini API Config node (uses API key from config) | |
| modelopt | COMBO | gemini-3.1-flash-image | Image generation model (overrides client model) |
| temperatureopt | FLOAT | 1.00–2 | Creativity level (higher = more creative) |
| aspect_ratioopt | COMBO | default | Image aspect ratio (all 14 ratios for 3.1 Flash; 10 for 3 Pro and 2.5 Flash) |
| image_sizeopt | COMBO | default | Image resolution (1K-4K for 3.1 Flash and 3 Pro; 2.5 Flash fixed at 1024px) |
| response_modalitiesopt | COMBO | IMAGE | What to return - image only or both text description and image |
| enable_google_searchopt | BOOLEAN | false | Enable Google Search grounding (Gemini 3 models only, not 2.5 Flash) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| description | STRING | — |