ComfyUI-Nanobanana Nano Banana 2
Resolution control, thinking, and a peek at its thoughts
- images
- image
- text
- thought_image
- response_json
The original Nano Banana (Gemini 2.5 Flash Image) got one thing that everyone wanted from a cloud image model in ComfyUI: a native node that speaks the Gemini API directly. Nano Banana 2 is the follow-up in the same pack - it maps to Google's gemini-3.1-flash-image-preview, Google's speed-and-quality hybrid released in February 2026 - and it's where this pack stops being a simple wrapper and starts exposing what makes the newer model interesting.
Where the base node is a fixed-aspect, fixed-size affair, this one hands you three knobs the original doesn't have: output resolution, a thinking_level, and the ability to see the model's "thought" images before it commits to the final render. That last one is the crowd-pleaser.
What's actually new
Three inputs appear here that don't exist on the plain Nano Banana node:
- resolution -
1K,2K, or4K. The base Flash model had no resolution choice at all; here it maps toimageConfig.imageSizein the API payload. 4K is the headline feature of the newer Gemini image models, so this is the box you'll tick when you actually want print-sized output. - thinking_level -
minimal,low,medium, orhigh. This is Gemini reasoning before it renders: the model works out composition and how to interpret your prompt, then generates. Higher levels cost more and take longer but follow harder prompts more faithfully. Default ishigh. - include_thoughts - a boolean that asks the API to return the intermediate "thinking" images, which land on a dedicated thought_image output.
The thinking images are genuinely fun to watch - it's like seeing the model sketch drafts before the final. Note that if the model returns no thought image at all, the node hands you a placeholder black IMAGE rather than an error, so you can still wire the output up and keep the graph happy. There's no direct relationship between thought images and the final result - they're process, not controls - but for understanding why a prompt went sideways, they're the best debugging tool this pack has.
The aspect_ratio list also grows: alongside the usual 1:1, 2:3, 4:3 etc. you get ultra-wide options like 8:1 and 1:8 (and 4:1, 1:4), which the base model simply doesn't accept. If you've been faking wide cinematic crops in post, this is where that workflow gets simpler.
Everything else is inherited from the base node: prompt, seed, response_mode, optional images (now up to 14 reference images instead of 3), system_prompt, model_override, and parallel_requests. Outputs are image, text, thought_image, and response_json.
Installing and configuring
Same pack, same drill as the plain Nano Banana node - this is just a second class in magicwang1111/ComfyUI-Nanobanana:
cd ComfyUI/custom_nodes
git clone https://github.com/magicwang1111/ComfyUI-Nanobanana.git
cd ComfyUI-Nanobanana
python -m pip install -r requirements.txt
Restart ComfyUI, search for "ComfyUI-Nanobanana Nano Banana 2", and you're set. No models to download; the only real setup is config.local.json in the pack folder with your Gemini API key (api_key, base_url, auth_mode, send_seed - copy config.example.json and fill it in). Env vars like GEMINI_API_KEY work as a fallback if you'd rather not keep keys in files.
Where people get burned
- Billing, not code. These nodes run against your Google project. If you see 401/403, verify billing is enabled - API credits from ImageFX or other Google surfaces don't automatically transfer to the API.
- 429s are common on the newer models. Image generation throttles hard, and
thinking_level=high+ 4K is the slowest, priciest combo. Start at 1K and medium thinking while you iterate. - Relay quirks. If you're using a Gemini-native relay, it may reject
generationConfig.seed- setsend_seedtofalsein config. And if the relay names the model differently, use model_override on the node; local validation still follows this node's model spec. include_thoughtshas a cost. It's off by default for a reason - every thought image is extra tokens on the bill. Turn it on when you're debugging, off for bulk runs.
Nano Banana 2 is the speed-quality middle child: not the raw power of Pro, not the cheap simplicity of the original. For day-to-day reference editing with a resolution choice, it's the one I'd reach for.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| seed | INT | 420–18446744073709550000 | — |
| aspect_ratio | COMBO | auto | 15 options: auto, 1:1, 1:4, 1:8, 2:3, 3:2, +9 |
| response_mode | COMBO | IMAGE+TEXT | 2 options: IMAGE+TEXT, IMAGE |
| imagesopt | IMAGE | — | |
| system_promptopt | STRING | You are an expert image-generation engine. You must ALWAYS produce an image. Interpret all user input—regardless of format, intent, or abstraction—as literal visual directives for image composition. If a prompt is conversational or lacks specific visual details, you must creatively invent a concrete visual scenario that depicts the concept. Prioritize generating the visual representation above any text, formatting, or conversational requests. | — |
| model_overrideopt | STRING | — | |
| parallel_requestsopt | INT | 11–8 | — |
| resolutionopt | COMBO | 1K | 3 options: 1K, 2K, 4K |
| thinking_levelopt | COMBO | high | 4 options: minimal, low, medium, high |
| include_thoughtsopt | BOOLEAN | false | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| text | STRING | — |
| thought_image | IMAGE | — |
| response_json | STRING | — |