Kie Nano Banana 2
Nano Banana 2 inside ComfyUI, without the VRAM bill — the Kie API node explained
- reference_image
- images
- task_id
Nano Banana 2 is Google's image model - the speed-quality hybrid that dropped in February 2026 on Gemini 3.1 Flash. It's also completely closed. No weights to download, no GGUF to fit on your card; you only ever reach it through an API or ImageFX. KieNanoBanana2 is the ComfyUI front door to that API, through a third-party reseller called Kie AI. You hand it a prompt and an API key, and it hands you back a normal ComfyUI IMAGE tensor. Same graph, different planet.
The name isn't a lie, but it's worth being precise about: the model is Google's, the API is Kie's, and nothing runs on your machine. This is one of the API category nodes - the ones that let you lean on a closed-source model for the bits where open weights still fall short, then keep the result inside your local workflow. For Nano Banana specifically, that's a real pitch: the community's honest verdict is that it's powerful but "unimaginative" and aggressively filtered. If you want prompt adherence, clean text rendering, or reference-image fidelity without babysitting a local model, an API node like this is the pragmatic path. It's also handy when you're on a low-VRAM box and your "GPU" is somebody else's data center.
How it works
The node is a thin async client for Kie's API. When you run it, it does four things in order: uploads any reference images to Kie's base64 upload endpoint, creates a generation task (model: "nano-banana-2"), polls the task-detail endpoint until it succeeds, fails, or times out, then downloads the result images and decodes them back into a tensor. Polling starts every 2 seconds, backs off to 5, then 15 as a task drags on - sensible, since these jobs typically take well under a minute but can occasionally hang around.
One implementation detail worth knowing: reference images are converted to base64 PNGs and uploaded per image, in batch order. So if you feed it a batch of four reference images from elsewhere in your graph, all four get sent up and the model sees them in order - the mechanism for a simple multi-reference setup.
The inputs that matter
You only really touch a handful of these:
- prompt - the only required text. Leave it empty and the node raises immediately, so there's no silent no-op.
- api_key - the one gotcha. You can paste it in, but the README warns it then lives inside your workflow JSON, which is a leak if you share workflows. Better: set the
KIE_API_KEYenvironment variable, or copyconfig.example.jsontoconfig.jsonin the pack folder and put the key there. Resolution order is node input → env var → config file. - aspect_ratio -
auto,1:1,16:9,9:16,4:3,3:4.autojust lets the model pick. - resolution -
1Kor2K, default2K. Unlike Nano Banana Pro's native 4K, 2K is this model's ceiling. - google_search - a boolean passed straight through to the API request; on Gemini image models that typically turns on search-grounded generation. Defaults to off.
- poll_timeout_seconds - default 600, min 30, max 3600. If a task legitimately runs long, bump it; if you want it to fail fast on a dead request, drop it.
- reference_image - optional
IMAGE, single or batch, the input for image-to-image work.
Two outputs: images (the batch of generated images, wire it into SaveImage or your upscaling chain) and task_id (the Kie task string, useful for checking the job on Kie's side or debugging).
Installing it
If you're on ComfyUI Manager, just search the pack title ComfyUI-KieAPI. Otherwise:
cd ComfyUI/custom_nodes
git clone https://github.com/Song367/ComfyUI-KieAPI
Restart ComfyUI and you're done. No model downloads, no heavy dependencies - the requirements.txt is just aiohttp, numpy, Pillow and pydantic, all of which you almost certainly already have. What you do need is a Kie AI account and a pay-as-you-go API key; this is a paid remote service, not free compute.
Common issues
- "Kie API key is required" - you gave it nothing anywhere. Set the node input,
KIE_API_KEY, orconfig.json. - Task fails - the node raises with Kie's
failCode/failMsg, so read the error. Model availability on resellers like this shifts (Kie's catalog has already shuffled models before), so an unexpected failure can mean the model name changed on their side. - Slow or hung generation - raise
poll_timeout_secondsbefore blaming the node; the default 10 minutes covers most runs, but 2K output with references can crawl.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| api_key | STRING | — | |
| aspect_ratio | COMBO | auto | 6 options: auto, 1:1, 16:9, 9:16, 4:3, 3:4 |
| resolution | COMBO | 2K | 2 options: 1K, 2K |
| output_format | COMBO | png | 2 options: png, jpg |
| google_search | BOOLEAN | false | — |
| poll_timeout_seconds | INT | 60030–3600 | — |
| reference_imageopt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| task_id | STRING | — |