NanoBanana - Image Generation (Nano Banana)
Google's Nano Banana, without the browser tab
- ref_image_1
- ref_image_2
- ref_image_3
- ref_image_4
- network
- image
This is the node most people download the NanoBanana2 pack for. It drops Google's Gemini image models - Nano Banana, Nano Banana 2, and Nano Banana Pro - straight into your ComfyUI graph, no browser tab, no ImageFX, no local GPU. Everything runs on Google's servers via the Gemini API, so the whole "which checkpoint, which VRAM" question goes away. In exchange you pay per image and you live inside Google's content filters and watermark policy. That's the trade you're signing up for.
The name is a gift. "Nano Banana" started as an anonymous codename on a HuggingFace leaderboard, Google's execs started posting banana emojis, and the name stuck as official branding. This pack (which shares the name) is by IxMxAMAR and ships 29 nodes that wrap basically the entire Gemini SDK. But the ImageGen node is the heart of it.
How it works
Under the hood it's a single generate_content_stream call with response_modalities set to IMAGE + TEXT. Your reference images get encoded as JPEGs (95 quality), each one labeled --- [Reference Image N] --- so the prompt can point at them by number, and the streamed response is decoded back into a ComfyUI image tensor. Nothing runs locally except the encode/decode - your prompt and images travel to Google and a finished image comes back.
One detail worth knowing: set candidate_count above 1 and you get all of them back as a batched IMAGE tensor you can wire straight into Preview Image or Save Image. Earlier versions charged you for four candidates and quietly handed you one; the current release returns the whole lot. If a safety refusal happens, the error tells you which category tripped it and quotes the model's own explanation, so you're not guessing.
The inputs that matter
- prompt - your image description. Use
[Reference Image N]to refer to wired-in reference images (up to 4 of them). - aspect_ratio - 1:1 through 21:9, plus AUTO. Defaults to 16:9.
- image_size - AUTO, 1K, 2K, or 4K. Nano Banana Pro's 4K native output is a big chunk of why people pay for it.
- candidate_count - how many variants you want (1–4).
- seed - -1 for random, or a fixed number to reproduce a run. Note every node in this pack re-executes on every run even with identical inputs - it's deliberate, so don't expect caching to save your seed.
- thinking_level - defaults to NONE (thinking is opt-in because it costs more). The Pro model can reason about the prompt before generating if you bump this.
The single output, image, is a standard IMAGE tensor, so it feeds anything else in the graph. There's also safety_settings_json (from the pack's Safety Settings node) and a network input if you need to route through a proxy.
Installing it
Install once, get all 29 nodes. ComfyUI Manager: search NanoBanana2 and install. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/IxMxAMAR/ComfyUI-NanoBanana2
pip install google-genai
Then restart ComfyUI and grab a key from aistudio.google.com ("Get API Key"). Paste it into the node, or set GEMINI_API_KEY as an environment variable and leave the field blank - it picks that up automatically, even strips stray quotes from your .env file. No model files to download; the only dependency is the google-genai SDK.
Where people get burned
The two real gotchas are regional availability and the filters. Nano Banana access isn't the same on every account and in every region - if your key can't see the model, your call 400s. The pack's List Available Models node tells you what your key actually has, and the Network Route node exists precisely for the US-egress problem. And if a prompt trips the image safety policy, that's a refusal, not a bug - rephrase, don't re-run. Model names are previews and rotate; if Google drops something new, the custom_model override field accepts it before the dropdown catches up.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | NanoBanana - API key. Leave blank to use GEMINI_API_KEY env var. | |
| model | COMBO | gemini-3.1-flash-image-preview | NanoBanana - image model. For Imagen models, use the dedicated Imagen Image Generation node instead. |
| custom_model | STRING | Override with a custom model ID. | |
| prompt | STRING | Image generation prompt. Use [Reference Image N] to refer to inputs. | |
| aspect_ratio | COMBO | 16:9 | Output image aspect ratio. |
| image_size | COMBO | 4K | Output image resolution. |
| system_instructionopt | STRING | System instruction for the image generation model. | |
| thinking_levelopt | COMBO | NONE | How much the model should reason before generating. |
| temperatureopt | FLOAT | 1.000–2 | Controls randomness in generation. |
| seedopt | INT | -1-1–2147483647 | Random seed for reproducibility (-1 = random). |
| candidate_countopt | INT | 11–4 | Number of image candidates to generate. All are returned as a batch — wire into Preview Image or save the lot. |
| ref_image_1opt | IMAGE | First reference image. | |
| ref_image_2opt | IMAGE | Second reference image. | |
| ref_image_3opt | IMAGE | Third reference image. | |
| ref_image_4opt | IMAGE | Fourth reference image. | |
| safety_settings_jsonopt | STRING | JSON safety settings from Safety Settings node. | |
| networkopt | NB_NETWORK | Optional. Wire a NanoBanana - Network Route node here to route this request through that proxy (e.g. US egress). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |