Google Gemini - Image Generation
Gemini text-to-image
- image
- description
- response_info
Google Gemini - Image Generation is the pack's text-to-image node, and what you're actually calling is the model the community calls Nano Banana - Google's Gemini-native image generator. There are no weights for this thing. You can't download it, you can't run it on your GPU, and no amount of VRAM changes that. If you want Nano Banana, you call it over the API, and this node is the thin client that drops the result back into your workflow as a normal IMAGE tensor. It's the "closed model in an open graph" move, and it plugs into everything downstream - preview, save, upscale, or a video model that animates what Gemini just drew.
How it works
Type a prompt, and the node posts a generateContent request asking for both text and image output (responseModalities: ["TEXT", "IMAGE"]). Gemini replies with a text part - its own description of what it made - plus an image part, which the node base64-decodes back into a tensor. No local model, no GPU work; the only heavy lifting is the network call.
The model dropdown ships with three choices:
- gemini-2.5-flash-image (default) - the original Nano Banana, fast and cheap
- gemini-3-pro-image-preview - Nano Banana Pro, 4K native, "thinking mode," the flagship
- gemini-3.1-flash-image-preview - Nano Banana 2, the speed/quality hybrid
Inputs and outputs
The one you'll always set is prompt (multiline). After that the useful knobs are aspect_ratio (from 16:9 and 21:9 down to 9:16, default auto), image_size (auto / 1K / 2K / 4K), and seed for reproducible runs. Two quirks worth knowing straight from the source: image_size is silently ignored on the 2.5-flash model (it only applies to the Pro line), and seed is only sent to the API if you set it above 0. temperature, top_p, max_tokens, and system_instruction are there if you want them; api_key / base_url are runtime overrides you can leave empty if you configured the key once.
Three outputs: image (wire to Preview Image / Save Image - it's a normal IMAGE), description (Gemini's text summary of the image), and response_info (a JSON string with the model, settings, and a status field). Wire description to a text node if you want to see it; response_info is your debugging window when a run fails.
Install
cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/DannyTuu/Comfyui_gemini_node.git
python -m pip install -U requests pillow numpy
Then restart, or use ComfyUI Manager to search Comfyui_gemini_node. No model files to download. You need a Gemini API key (AI Studio is the easiest start) - or, because this pack lets you override base_url, a reseller endpoint if you want cheaper per-image pricing than Google's own $0.039–0.24/image tiers.
Where people get burned
- Per-call cost. Every generation is metered, and Pro at 4K is the expensive tier. The community's own refrain about API nodes applies: it's the right tool for a model you can't run, and the wrong default for one you can.
- The filter follows the model. Nano Banana is aggressively moderated - IMAGE_SAFETY filtering, strict famous-IP and celebrity restrictions, and an invisible SynthID watermark on everything. There's no abliterating it; the refusal is at Google's servers, not in weights you own.
- Watch
descriptionandresponse_infoon failures. Like the pack's other nodes, errors are returned as text rather than thrown, so a busted run still "succeeds" from ComfyUI's point of view. When you getNoneout of the image socket, read the description string - it usually says exactly what went wrong. - The classic hybrid worth stealing: generate a hero frame with Nano Banana Pro, then animate it with an open video model like Wan in the same graph. That's the pattern the community has settled on - closed Google model for the hard frame, open weights for the motion.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| model | COMBO | gemini-2.5-flash-image | 3 options: gemini-2.5-flash-image, gemini-3-pro-image-preview, gemini-3.1-flash-image-preview |
| api_keyopt | STRING | — | |
| base_urlopt | STRING | — | |
| temperatureopt | FLOAT | 1.00–2 | — |
| top_popt | FLOAT | 0.950–1 | — |
| max_tokensopt | INT | 81921–65536 | — |
| system_instructionopt | STRING | — | |
| aspect_ratioopt | COMBO | auto | 11 options: auto, 16:9, 4:3, 4:5, 3:2, 1:1, +5 |
| image_sizeopt | COMBO | auto | 4 options: auto, 1K, 2K, 4K |
| seedopt | INT | 00–2147483647 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| description | STRING | — |
| response_info | STRING | — |