Nano Banana 2 Multi-Turn Chat
Keep editing the same image, turn after turn
- image_1
- image_2
- image_3
- image_4
- image_5
- image_6
- image_7
- image_8
- image_9
- image_10
- image_11
- image_12
- image_13
- image_14
- image
- response_text
- metadata
- chat_history
You know the loop. Generate an image, look at it, want a tiny change, but the AIO node has already forgotten everything you did. NanoBanana2MultiTurnChat exists to kill that loop: it keeps the conversation - and the last image it made - alive in memory, so you can tell it "change the background to a sunset beach," then "add water droplets," then "close up on the bottle," and each run builds on the last.
It's part of the ru4ls/ComfyUI_Nano_Banana pack, and it's the chat version of the pack's Nano Banana 2 side, running the fast gemini-3.1-flash-image-preview model. Everything's still cloud-side - paid API calls, no local model - but for iterative editing the conversational interface is genuinely the right tool, because the model gets the previous image back as a reference rather than you manually re-feeding generations.
How it works
The trick is state, and it lives inside the node instance. When you run it, the node remembers the last image it generated (last_image_data) and a full conversation_history list. On the next run it injects that previous image back into the request alongside your new prompt, so the model is literally editing what it just made. Flip reset_chat to True and both get wiped for a fresh start.
That in-memory design has one practical consequence you should internalize: duplicate the node and you get a blank history. Copy the node to "reset" it visually and it won't remember anything the original did. Same after a ComfyUI restart. There's no persistence to disk - if you want to keep a thread going, keep using the same node instance, and use reset_chat when you want out.
The inputs that matter
prompt- each run is a new instruction in the ongoing thread.reset_chat- the kill switch. Toggle toTrueonce to wipe history and start over.use_search/use_image_search- web and image grounding; the image variant needsuse_searchon. Both default off here.image_1throughimage_14- reference images for the start of a conversation (up to 10 objects + 4 characters, per the model's design). After the first turn, the node's own output becomes the reference.aspect_ratio- all 15 options including the extreme1:4,1:8,4:1,8:1andAuto.image_size-512pxthrough4K; the cheap 512px drafts are a great fit for rapid multi-turn exploration.
Outputs: image (the latest result), response_text (the model's words, which matter when it refuses or explains), metadata (finish reason + safety ratings), and chat_history (the full thread as a string). Wire image into PreviewImage or SaveImage.
Installing
It's a node in the ComfyUI_Nano_Banana pack - the install is identical to the other three nodes in this pack. ComfyUI Manager: search "ComfyUI_Nano_Banana". Or manual:
cd ComfyUI/custom_nodes
git clone https://github.com/ru4ls/ComfyUI_Nano_Banana.git
pip install -r ComfyUI_Nano_Banana/requirements.txt
pip install google-genai --upgrade # required for Nano Banana 2 nodes
Then drop a GOOGLE_API_KEY (Gemini API) or PROJECT_ID + LOCATION (Vertex AI) into the pack's .env - copy .env.api.template or .env.vertexai.template to get started. The pack auto-detects which you've configured.
Gotchas
- Every turn is a paid API call. A five-turn edit chain is five generations on your bill. Keep the first passes at
512px/1Kand only spend on4Kfor the final. - History is volatile. It's node-instance memory, not saved state. Restart ComfyUI, or duplicate the node, and the thread is gone.
- Search toggles default off - if the model isn't grounded, that's why.
- Same family filters as the rest of Nano Banana. Google's safety filtering is aggressive here; the model will refuse a whole class of edits without drama.
- Old
google-genaibreaks this node - the SDK must be current or the NB2 request tooling errors out.
If you want the same conversational flow but with the highest-quality Pro model instead of the fast one, the pack's older NanoBananaMultiTurnChat node does exactly that. This one's the speed pick.
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | gemini-3.1-flash-image-preview | 1 options: gemini-3.1-flash-image-preview |
| prompt | STRING | Create an image of a clear perfume bottle sitting on a vanity. | — |
| reset_chat | BOOLEAN | false | — |
| use_search | BOOLEAN | false | — |
| use_image_search | BOOLEAN | false | — |
| aspect_ratio | COMBO | 1:1 | 15 options: 1:1, 1:4, 1:8, 2:3, 3:2, 3:4, +9 |
| image_size | COMBO | 2K | 4 options: 512px, 1K, 2K, 4K |
| temperature | FLOAT | 1.00–2 | — |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| image_5opt | IMAGE | — | |
| image_6opt | IMAGE | — | |
| image_7opt | IMAGE | — | |
| image_8opt | IMAGE | — | |
| image_9opt | IMAGE | — | |
| image_10opt | IMAGE | — | |
| image_11opt | IMAGE | — | |
| image_12opt | IMAGE | — | |
| image_13opt | IMAGE | — | |
| image_14opt | IMAGE | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| response_text | STRING | — |
| metadata | STRING | — |
| chat_history | STRING | — |