π Nano Banana Chat Edit
An image editor you can argue with
- input_image
- chat_history
- edited_image
- response_text
- chat_history
Nano Banana is Google's rebrand of its Gemini-native image generation - Pro (Gemini 3, 4K native, best text rendering) and Flash/Nano Banana 2 (faster, cheaper, with a thinking mode). It's API-only: no weights to download, no GPU required, and you pay per image. The Nano Banana Chat Edit node is the pack's conversational side: instead of one prompt in, one image out, you get an editing session where each turn builds on the last.
That's the whole pitch. You load an image, type "change the sky to sunset," get an edit, then chain a second node and say "now make it stormy," and the model still remembers the scene. It's like a chat session with ImageFX, except the result lands as a normal ComfyUI IMAGE tensor - so it can flow straight into your upscaler, FaceDetailer, or whatever else your pipeline does. That's the real reason to reach for it: iterative edits that stay inside your graph instead of bouncing you between a web app and ComfyUI.
How it works
Under the hood it uses Google's google-genai SDK. Each call creates a chat session (client.chats.create) carrying the accumulated chat_history, then sends your instruction. One detail worth knowing: the input_image is only attached on the first turn. Once a chat_history is wired in, the node skips re-sending the image and relies on the conversation. Feed it a brand-new base image later and it ignores it - start a fresh chain (no chat_history) if you want a different starting point.
The response is parsed into three outputs: edited_image (the actual IMAGE, wire it to Save Image or a preview), response_text (the model's description of what it did - handy as a log or a caption), and chat_history (NANO_BANANA_CHAT_HISTORY), which you pass to the next Chat node to keep the conversation going.
The inputs that actually matter
- instruction - your edit command. Be specific; it supports multiple languages.
- input_image - the base image to transform (only used on turn one).
- chat_history - the previous turn's output, chained in for multi-turn edits.
- model - Flash (default) or Pro. Flash does thinking, 512px, and extreme aspect ratios like 1:8; Pro is the quality pick but drops those features.
- thinking_level - reasoning depth, Flash only. Set it on Pro and the node quietly strips it so the request doesn't error out.
- temperature - keep it at 1.0. That's Google's own recommendation for Gemini 3, and the tooltip warns lower values can cause looping.
- max_output_tokens - the default 8192 is right for 1K; the 4K output eats roughly 2,520 tokens by itself, so don't drop this below ~2048 for 1K.
- safety_hate_speech / harassment / sexually_explicit / dangerous_content - defaults to the most permissive
BLOCK_NONE, but that only loosens the configurable filters. - enable_search_grounding - let the model check the web before generating. 5,000 free searches/month, Flash gets image search too.
Installing and the key
Same as the whole pack: ComfyUI Manager (search "comfyui-nano-banana"), or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/fwlemos/NBP-Comfyui.git
pip install -r NBP-Comfyui/requirements.txt
Restart after. Dependencies are just google-genai, requests, and Pillow - no model downloads. You do need a Google AI Studio API key (set GOOGLE_API_KEY, drop it in google_api_key.txt, or wire in the pack's Google API Key node). Nano Banana Pro runs about $0.039β0.24 per image depending on resolution, so 4K edits add up.
Where people get burned
The biggest wall is Google's content filter, not the node. Even with everything set to BLOCK_NONE, an internal image filter still blocks independently - the community calls Nano Banana "powerful, unimaginative, massive hidden biasing," and a January 2026 policy update tightened image filtering and celebrity/IP generation further. When a generation just refuses, the fix is usually rephrasing, not flipping a toggle.
Other realistic failure modes: a 401 or "No Google API key found" (the error message tells you the three places to put it), 429 rate limits at roughly 20 images/minute, and validation warnings when you ask Pro for something it can't do - the pack logs those instead of failing, and falls back gracefully.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| instruction | STRING | Describe the image you want to generate. Be specific about subject, style, lighting, composition. Supports multiple languages. | |
| model | COMBO | gemini-3.1-flash-image-preview | Nano Banana Pro = highest quality, best text rendering. Nano Banana 2 (Flash) = faster, cheaper, supports thinking & 512px & extreme aspect ratios. |
| aspect_ratio | COMBO | 1:1 | Output image proportions. Pro supports 10 ratios. Flash supports 14 including extreme (1:8, 8:1). Invalid ratios for the selected model will be flagged. |
| image_size | COMBO | 1K | Output resolution. 512px (Flash only), 1K (1024px), 2K (2048px), 4K (4096px). Larger = higher quality but more tokens billed. |
| system_instruction | STRING | Persistent instruction that guides model behavior. Sits above the user prompt. Use for consistent style direction, persona, or constraints across generations. | |
| temperature | FLOAT | 1.000β2 | Controls randomness (0.0β2.0). Lower = more predictable, higher = more creative. Google recommends keeping at 1.0 for Gemini 3 models β lower values may cause looping. |
| top_p | FLOAT | 0.950β1 | Nucleus sampling (0.0β1.0). Model considers the smallest token set whose cumulative probability β₯ this value. Lower = more focused. Tip: adjust either temperature OR top_p, not both. |
| top_k | INT | 401β100 | Top-k sampling (1β100). Model considers only the K most probable tokens. Lower = more predictable, higher = more creative. |
| max_output_tokens | INT | 81921024β32768 | Max output tokens (text + thinking + image). Image tokens: ~1,120 for 1K, ~1,600 for 2K, ~2,520 for 4K. Too low = image may fail. Recommended minimum: 2048 for 1K, 8192 for 4K. |
| thinking_level | COMBO | minimal | Reasoning depth (Flash/NB2 ONLY). Higher = better quality, more tokens. β οΈ IGNORED for Pro β causes API error if sent. |
| api_keyopt | STRING | Your Google AI Studio API key. Leave blank to use GEMINI_API_KEY environment variable. | |
| input_imageopt | IMAGE | β | |
| chat_historyopt | NANO_BANANA_CHAT_HISTORY | β | |
| safety_hate_speechopt | COMBO | BLOCK_NONE | Hate speech filter. BLOCK_NONE = most permissive. OFF = disabled. Note: an internal image filter may still block independently. |
| safety_harassmentopt | COMBO | BLOCK_NONE | Harassment filter. BLOCK_NONE = most permissive. OFF = disabled. |
| safety_sexually_explicitopt | COMBO | BLOCK_NONE | Sexually explicit filter β most common cause of blocked generations. BLOCK_NONE = most permissive configurable setting. |
| safety_dangerous_contentopt | COMBO | BLOCK_NONE | Dangerous content filter. BLOCK_NONE = most permissive. OFF = disabled. |
| enable_search_groundingopt | BOOLEAN | false | Google Search grounding. Model searches web before generating for real-world accuracy. Flash supports web + image search; Pro web only. 5,000 free/month. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| edited_image | IMAGE | β |
| response_text | STRING | β |
| chat_history | NANO_BANANA_CHAT_HISTORY | β |