NanoBanana Generate
Cloud images from ComfyUI, and why the name is a trap
- task_id
- response_json
- result_image
First, the name is a trap. "NanoBanana" here is not Google's Nano Banana - the Gemini image model everyone compares everything to. It's a third-party hosted image API at api.nanobananaapi.ai that borrowed the marketing, and this node just fronts it. No local model, no GPU, no weights. You paste an API key, type a prompt, and the image comes back over HTTP. That's the whole job, and it's also the reason the service has a genuinely mixed reputation in the community - worth knowing before you buy a year of credits.
Why you'd reach for it
This is the single-platform node inside AlexXia007/AIYang_TripleAPI, a small pack that wraps hosted image APIs into ComfyUI. Where the pack's other node fires three services at once, this one does just NanoBanana. You reach for it when you want generation quality without touching your VRAM, when your GPU is busy, or when you want to test-drive one service before committing to the triple shot. It also does image-to-image against reference URLs, so it doubles as a style-transfer or "improve this image" node.
How it works
The node builds a JSON request - your prompt, the generation type, image count, size, plus optional seed and watermark - and POSTs it to the server. The API is asynchronous: the first call just returns a task_id. From there you have a choice. Flip wait_for_result on (it defaults off) and the node polls the API's record-info endpoint every poll_interval_seconds until it gets a finished image or hits poll_timeout_seconds, then downloads the returned URLs into a proper ComfyUI image tensor - original sizes preserved, multiple images batched. Leave it off and you get the task ID and raw JSON but no image at all.
The inputs and outputs that matter
You'll actually set maybe four things:
- api_key - required. The node hard-fails with a ValueError (red node) if it's empty.
- prompt and type -
TEXTTOIAMGEvsIMAGETOIAMGE. Yes, that's a misspelling of "IMAGE", and yes, it ships in the API too. Not a typo you made. - num_images (1–4) and image_size_mode -
autoor an aspect preset like9:16,16:9,1:1. - image_urls_json - a JSON array of URLs, needed when type is
IMAGETOIAMGE. The node errors without it.
The rest - seed, watermark, server, timeout_seconds, wait_for_result, and the poll settings - you can leave alone until something misbehaves.
Outputs are three: result_image (IMAGE), task_id (STRING), and response_json (STRING). Wire result_image into a Preview Image or Save Image node; send task_id and response_json to a ShowText node when you're debugging an empty output.
Install
Same for the whole pack - no models to download, and dependencies are just Pillow, numpy and torch, which ComfyUI already ships:
cd ComfyUI/custom_nodes
git clone https://github.com/AlexXia007/AIYang_TripleAPI.git
cd AIYang_TripleAPI
pip install -r requirements.txt
Restart ComfyUI and it shows up as NanoBanana Generate under the NanoBanana category. ComfyUI Manager can find it by "AIYang_TripleAPI" too.
Common issues
- No image on the IMAGE output. You almost certainly left
wait_for_resultoff - the node returns the task ID but aNoneimage. Tick it, or handle the async flow yourself viatask_id. - Red node with "未提供 API Key". The key field is genuinely required. Get one at nanobananaapi.ai.
- Caveat emptor on the service itself. This API is unaffiliated with Google, sells prepaid credits, and community reports on refunds are inconsistent - the "is this a scam" question has come up more than once. Test with a small credit pack before committing.
- The pack is tiny and its docs rot. The README is Chinese-only and describes an img2img sibling node that isn't actually registered in the shipped code. Treat the README as a hint, not ground truth.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| type | COMBO | TEXTTOIAMGE | 2 options: TEXTTOIAMGE, IMAGETOIAMGE |
| num_images | INT | 11–4 | — |
| api_key | STRING | — | |
| image_size_mode | COMBO | auto | 11 options: auto, 1:1, 9:16, 16:9, 3:4, 4:3, +5 |
| image_urls_jsonopt | STRING | [] | — |
| seedopt | INT | -1-1–99999999 | — |
| watermarkopt | STRING | — | |
| serveropt | STRING | https://api.nanobananaapi.ai | — |
| timeout_secondsopt | INT | 605–300 | — |
| wait_for_resultopt | BOOLEAN | false | — |
| poll_interval_secondsopt | INT | 31–60 | — |
| poll_timeout_secondsopt | INT | 2405–3600 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| task_id | STRING | — |
| response_json | STRING | — |
| result_image | IMAGE | — |