💀Image with Gemini
Nano Banana, without leaving ComfyUI — 💀Image with Gemini
- images
- image
- text
💀Image with Gemini is a ComfyUI node that generates images through Google's Gemini API using your own key - and here's the fun part: underneath the hood it's calling the model the community nicknamed Nano Banana, aka Gemini 2.5 Flash Image. The source hard-codes gemini-2.5-flash-image-preview as the model; there's no dropdown, you just get the best-known consumer Gemini image model wired into the graph.
That's genuinely useful. Closed image generators like Nano Banana and GPT Image are exactly what local ComfyUI setups can't replicate - the quality is there and the checkpoint isn't downloadable. The usual workaround is leaving ComfyUI to fetch a picture from a web app. This node keeps that closed-model power inside your workflow, so the generated image drops straight back into the graph for upscaling, compositing, or a second pass. The trade-off, obviously, is that it's per-image API billing on your own Google key - the pack's whole pitch is "your key, your bill, nothing stored."
How it works
The node builds a request against Google's Generative Language API with your prompt and api_key, waits for the response, decodes the returned image into a ComfyUI IMAGE tensor, and returns it. Two outputs come back: image (the IMAGE tensor) and text (a STRING - Gemini's image models often return a revised/description payload alongside the picture, and that's what you get here).
The optional images input is where it gets interesting: feed it a reference image and the node treats it as context, which turns this into an image-edit / style-transfer node rather than a pure text-to-image one. Also note the seed defaults to 42, and like the rest of this pack, results are cached to disk in the pack's cache/ folder - rerun identical inputs and you'll get the cached image back, not a fresh API call.
The inputs that matter
prompt- what you want generated (multiline; Nano Banana responds well to natural language, so don't over-engineer it into booru tags).api_key- your Google AI Studio / Gemini API key, pasted directly on the node. It lives in the workflow JSON, so be careful sharing files.seed- defaults to 42 for reproducibility.images(optional) - reference image(s) for context and editing.
Outputs: image → any IMAGE socket (Save Image, upscaler, VAE-adjacent stuff), and text → any STRING socket.
Install
Part of ComfyUI-PromptsO; install the pack once:
cd ComfyUI/custom_nodes/
git clone https://github.com/S4MUEL-404/ComfyUI-PromptsO.git
cd ComfyUI-PromptsO
pip install -r requirements.txt
Restart, then find it under the 💀 PromptsO category. ComfyUI Manager users can search "PromptsO" instead. The requirements are heavier than this node needs (torch, transformers, the Janus repo) because the pack bundles a local vision node - you only strictly need requests, pillow, and torch for image output here.
Common issues
- "API key cannot be empty" - you skipped the key, or pasted it with whitespace. There's no env-var fallback; it has to be on the node.
- Billing/limit errors - Gemini's free tier exists but image generation burns quota fast; a 429 means you're out of quota, not that the node is broken.
- Image looks fine but
textoutput is blank - some responses don't carry a text payload; the socket is just empty. Wire it if you need it, ignore it if not. - Same image every rerun - that's the disk cache talking. Bump the seed to get a fresh generation.
It's a niche node from a small pack, but it's the least-effort path I know to get Google's closed image model inside a ComfyUI graph with your own key and no middleman.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Text prompt for image generation | |
| api_key | STRING | Your Google Gemini API Key | |
| seed | INT | 420–18446744073709550000 | Seed for generation consistency |
| imagesopt | IMAGE | Optional reference images for context |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| text | STRING | — |