JAS Nano Banana Image Edit [set GEMINI_API_KEY]
Nano Banana edits, straight off your canvas — no Comfy login required
- image
- images
Nano Banana is Google's closed image model - you can't download it, and until recently the only way to touch it from ComfyUI was the official Partner Node, which wants a Comfy account and a prepaid credits balance. This node skips all of that. Paste in a GEMINI_API_KEY, wire an image into it, describe the edit, and it calls Google's Gemini API directly and drops the result back into your graph as a normal IMAGE tensor. Same model, no second login, no meter inside Comfy.
It runs gemini-3.1-flash-image-preview, the Nano Banana 2 generation of the line, so expect the things that model is good at: real text rendering, coherent editing of an existing subject, multi-turn-style instruction following. Also expect the things it can't do - more on those below.
How it works
Mechanically it's simple and worth knowing so you stop blaming it for weird results. The node takes your input image, converts it to a PNG, base64-encodes it, and builds a generateContent request to Google's API ({base_url}/{model}:generateContent?key=...). Your prompt and the image go in as content parts; the system_prompt field rides along as a systemInstruction; and aspect_ratio, resolution, and response_modalities are packed into generationConfig.imageConfig. Whatever comes back gets decoded into a tensor and handed to whatever node you connect the output to.
The inputs that matter
For a beginner, three of them carry the work:
- image - your input, wired from a Load Image. The whole edit is prompt-driven; there's no mask input on this node, so describe what should change ("make the sky a sunset, keep the girl's face identical").
- prompt - the actual instruction, multiline.
- system_prompt - defaults to "edit while preserving important visual identity," which is doing more heavy lifting than it looks like. Leave it alone until results surprise you, then it's your lever.
Beyond those: aspect_ratio (auto or 1:1 up to 21:9, default auto so it keeps the source's shape), resolution (1K/2K/4K - 4K is where Nano Banana earns its keep but it costs more per call), response_modalities (IMAGE or IMAGE+TEXT - pick IMAGE+TEXT if you want the model to explain what it changed; you still only get the picture out), and seed (accepted upstream, not deterministic - the README is upfront about this).
Output is a single images (IMAGE) tensor. Feed it to Save Image, Preview Image, or chain it into a local upscaler - that last one is the classic move, since 1K output is a bit soft.
Installing it
It ships in the comfyui_jas_nodes pack alongside five sibling nodes. In ComfyUI Manager, search "comfyui_jas_nodes" (or "JAS") and install, or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/reducm/comfyui_jas_nodes
cd comfyui_jas_nodes
python -m pip install -r requirements.txt # just `requests` - that's the only dependency
No model files, no VRAM, no heavy deps. Then set the key and restart ComfyUI from a shell that has it:
export GEMINI_API_KEY="your-key" # or GOOGLE_API_KEY, the node accepts both
The node name tells you the deal - "set GEMINI_API_KEY" isn't a decoration, it's the setup. The key lives in the environment, not in a node field.
Common issues
The usual failure is the env var: you set it in one terminal, ComfyUI runs from another, and you get GEMINI_API_KEY is not set. Set it in the shell you launch ComfyUI from, then fully restart - not just reload. After that, provider errors surface as the raw HTTP status and body, which is a feature: the 4xx message usually tells you exactly what Google refused. Remember the data leaves your machine to Google, and Google's own image-safety filter applies - the node can't bypass what the model refuses. And yes, every output carries Google's invisible SynthID watermark, like it or not.
The one real disappointment to set expectations on: no mask input here, so precise region edits are out. You're doing whole-image re-ideation, not surgery.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| prompt | STRING | — | |
| base_url | STRING | https://generativelanguage.googleapis.com/v1beta/models | — |
| model | COMBO | gemini-3.1-flash-image-preview | 1 options: gemini-3.1-flash-image-preview |
| aspect_ratio | COMBO | auto | 11 options: auto, 1:1, 2:3, 3:2, 3:4, 4:3, +5 |
| resolution | COMBO | 1K | 3 options: 1K, 2K, 4K |
| response_modalities | COMBO | IMAGE | 2 options: IMAGE, IMAGE+TEXT |
| seed | INT | 00–2147483647 | — |
| system_prompt | STRING | Edit the input image according to the user's instruction while preserving important visual identity where possible. | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |