Gemini Nano Banana Image
No GPU, no model, just a Gemini API key
- image_1
- image_2
- image_3
- image_4
- image_5
- image
- text
The name is the whole pitch. "Nano Banana" is Google's branding for its Gemini-native image generation - the same model behind ImageFX - and this node drops it straight into your ComfyUI graph. No checkpoint to download, no VRAM to budget, no LoRA training. You type a prompt, pay Google per image, and the result lands in a normal IMAGE tensor like any other sampler output.
The trade is obvious, so let's name it up front: this is an API wrapper, not a model. Everything happens on Google's servers. That buys genuinely strong text rendering and reference-image editing, and it costs you the thing most of ComfyUI's ecosystem is about - local, uncensored, free iteration. If you're after anime LoRAs or NSFW work, stop reading; the filters are baked in on Google's side and no node setting undoes them. If you need clean infographics, logos, product shots, or strong image-to-image edits, this is a lot of capability for a one-line dependency.
How it works
Under the hood the pack is refreshingly honest: it uses Google's official google-genai Python SDK and calls client.models.generate_content() with a GenerateContentConfig. That's it. The node's whole job is translating ComfyUI tensors into what the API wants and back - reference images become base64 PNGs, and the response's inline image data gets decoded back into a batched IMAGE tensor and a STRING of the model's text reply.
There are no hidden model files. requirements.txt is a single line: google-genai>=1.0.0. The models themselves are the three presets: gemini-2.5-flash-image (the original Nano Banana), gemini-3.1-flash-image-preview (Nano Banana 2), and gemini-3-pro-image-preview (Nano Banana Pro, the 4K flagship). Google rotates these names, which is why there's a custom_model field - type any newer model string there and it overrides the dropdown.
The inputs that actually matter
There are a lot of knobs, but a beginner really touches four:
prompt- your text-to-image or edit instruction. Multi-line, do everything here.api_key/api_key_env- resolution order isapi_key, thenapi_key_env(defaults toGEMINI_API_KEY), thenGOOGLE_API_KEY. Paste a key in the node or set an env var and leave it alone; the env route is better if you share workflows.model- pick your tier. Pro is the one people rave about; Flash is cheap for iterating.seed--1(the default) means "unspecified." Worth knowing Google's seeds are less deterministic than a local sampler's; don't expect pixel-perfect reproduction across calls.
The useful middle shelf: aspect_ratio (1:1 up to 21:9), image_size (1K/2K/4K), candidate_count (request 1–4 and pick), response_mode (TEXT_AND_IMAGE vs IMAGE_ONLY), and person_generation, which you may need to set to ALLOW_ADULT just to get a normal person in frame. enable_google_search lets Gemini browse before generating - flashy, rarely worth it. proxy_mode matters behind a proxy: the SDK honors environment proxies unless you set it to direct.
For image-to-image and editing, wire up to five reference images (image_1 through image_5) into the optional inputs and describe the change. One gotcha from the source: gemini-2.5-flash-image is capped at 3 reference images on this node; the other models take the full 5. And if Google returns mixed-size images, the node keeps only the first size group and appends a note to the text output - so keep batch sizes consistent.
The outputs are image (an IMAGE tensor - feed it to SaveImage, an upscaler, whatever) and text (the model's text reply, which can carry the mixed-size note). If the API returns no image at all, the node raises a hard error with the raw response text - Google's way of telling you a safety filter tripped or the model name is wrong.
Installing it
ComfyUI Manager is the easy route - search for comfyui-nano-banana-custom-node and install. Or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Leee62/comfyui-nano-banana-custom-node
Then install the SDK in the same Python environment ComfyUI runs in:
pip install -q -U google-genai
Restart ComfyUI and the node appears under Google AI/Gemini as "Gemini Nano Banana Image." No model download step - the only setup is the key.
Where people get burned
The #1 complaint you'll find in the wild isn't a bug in this node, it's the bill. Nano Banana's API is not free, and the free tier evaporates fast while you experiment. A graph that loops or a stray candidate_count of 4 multiplies your cost without multiplying your luck. Watch your billing page when you're tuning prompts.
Second: censorship. Google's image safety filtering is aggressive, and "powerful, unimaginative, massive hidden biasing" is the community's honest summary. If a generation silently returns nothing or a refusal, that's Google's filter, not your install - check the text output for the reason.
Third: don't paste your API key into shared workflow JSON. The api_key_env route exists precisely so a public workflow doesn't leak your billing account. Use it.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| language | COMBO | english | 2 options: english, chinese |
| model | COMBO | gemini-2.5-flash-image | 3 options: gemini-2.5-flash-image, gemini-3.1-flash-image-preview, gemini-3-pro-image-preview |
| custom_model | STRING | — | |
| api_key | STRING | — | |
| api_key_env | STRING | GEMINI_API_KEY | — |
| response_mode | COMBO | TEXT_AND_IMAGE | 3 options: MODEL_DEFAULT, TEXT_AND_IMAGE, IMAGE_ONLY |
| aspect_ratio | COMBO | default | 11 options: default, 1:1, 2:3, 3:2, 3:4, 4:3, +5 |
| image_size | COMBO | default | 4 options: default, 1K, 2K, 4K |
| candidate_count | INT | 11–4 | — |
| enable_google_search | COMBO | disable | 2 options: disable, enable |
| proxy_mode | COMBO | environment | 3 options: environment, direct, manual |
| proxy_url | STRING | — | |
| timeout_seconds | INT | 18030–900 | — |
| seed | INT | -1-1–2147483647 | — |
| person_generation | COMBO | default | 4 options: default, DONT_ALLOW, ALLOW_ADULT, ALLOW_ALL |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| image_5opt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| text | STRING | — |