google nano
Run Google's Nano Banana inside ComfyUI — no GPU, just an OpenRouter key
- image1
- image2
- image3
- image4
- image
- status
- key_status
This node is what you reach for when you want Google's Gemini image models - the ones the community calls Nano Banana - inside ComfyUI, without a local model and without a GPU to babysit. You feed it up to four reference images and a prompt, it phones OpenRouter, and back comes a finished image as a normal IMAGE tensor you can save, pass to an upscaler, or stick in a collage workflow. For a diffusion-head that's a weird feeling: no checkpoint, no VAE, no sampler, no denoise. Just an API call dressed up as a node.
Don't let the name fool you. "Google Nano" isn't Google's own integration and there's no Gemini API key involved - the node needs an OpenRouter key, and it routes every request through openrouter.ai/api/v1. It's the same deal as any closed-model-via-proxy node, so budget for real money if you leave the :free tier, and know that Nano Banana is aggressively censored (it refuses famous faces/IP and blocks a lot of prompts outright). It also embeds Google's invisible SynthID watermark. That's the trade-off for not running anything locally.
How it works
The mechanism is simple once you see it. The node converts your input images (PIL, then base64 data URLs), stuffs them and your prompt into an OpenAI-format chat completion request, and sends it to OpenRouter's image_url content endpoint. The response comes back as generated images, which get decoded back into a ComfyUI tensor. Because the heavy lifting is a thread pool on your side plus the API on theirs, it can run 1–10 concurrent jobs - the README is blunt that with concurrency you can end up with fewer images displayed in the UI than were actually generated. They're all saved to ComfyUI's output directory, so don't panic and re-run; go look.
The inputs that matter
api_key_main- required. Paste an OpenRouter key. There are also optionalapi_key_2/3/4slots, but the README's recommendation for more than a couple of keys iskey_management_modeset to use the config-file key mode: keys live inconfig.json(which the node auto-creates on first run) and can be hot-reloaded without restarting ComfyUI. The key-handling gets genuinely fancy - round-robin / random / weighted scheduling, automatic cooldown when a key hits rate limits, per-key usage stats in thekey_statusoutput.image1- required;image2–image4are optional reference images. You need at least one.prompt- for single-image runs. Give it a path infile_path(CSV or Excel with apromptcolumn, Chinese paths fine) and it batch-runs the whole file instead, which is this pack's real selling point.model- dropdown, defaultgoogle/gemini-2.5-flash-image-preview:free. The paid variant is there too; other OpenRouter models are configurable.max_concurrent,max_retries,enable_parallel,scheduling_mode- the tuning knobs for batch throughput and multi-key setups. Start conservative (max_concurrentdefaults to 3).
Outputs: image (wire into Save Image / Preview), plus status and key_status strings you can inspect or route into a text logger.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/annewj023/Comfyui_google_nano.git
cd ComfyUI_google_nano # or the cloned dir name
pip install -r requirements.txt
Or search "Google Nano" in ComfyUI Manager and let it handle the deps. You'll also need an OpenRouter account and key - the free Gemini tier is good for testing but has real limits (roughly 20 requests/minute, and 50 free requests/day unless you've bought credits). Restart ComfyUI, and "google nano" appears in the node search under the OpenRouter category.
Where people get burned
- "未安装 openai 库" / missing
openai-pip install openai; it's the pack's actual dependency for talking to OpenRouter. - No available API key - the key is empty or exhausted. If you pasted into the node and it's ignoring it, double-check
key_management_mode: with config-file mode set, it may be readingconfig.jsonand finding the placeholder "添加你的KEY" instead of your real one. - Rate limiting under concurrency - lower
max_concurrent, spread load across keys, and let the cooldown logic work. - Fewer images than expected - the concurrency display quirk from the README; everything's in your output folder.
One more heads-up: the node's tooltips and status strings are in Chinese, and the README is Chinese-first. The core flow is obvious enough, but if a setting confuses you, that's why - it's not you being dense.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key_main | STRING | 主API Key(必填) | |
| image1 | IMAGE | — | |
| api_key_2opt | STRING | API Key 2(可选) | |
| api_key_3opt | STRING | API Key 3(可选) | |
| api_key_4opt | STRING | API Key 4(可选) | |
| promptopt | STRING | 单图生成的提示词 | |
| file_pathopt | STRING | 批量处理的CSV/Excel文件路径 | |
| site_urlopt | STRING | 网站URL(可选) | |
| site_nameopt | STRING | 网站名称(可选) | |
| modelopt | COMBO | google/gemini-2.5-flash-image-preview:free | 选择要使用的AI模型 |
| max_concurrentopt | INT | 31–10 | 最大并发任务数量(1-10) |
| scheduling_modeopt | COMBO | round_robin | API Key调度模式:轮换/随机/加权 |
| enable_parallelopt | BOOLEAN | false | 启用并行模式(同时使用多个API Key) |
| max_retriesopt | INT | 30–10 | API调用失败时的最大重试次数 |
| enable_detailed_logsopt | BOOLEAN | true | 启用详细的任务执行日志 |
| key_management_modeopt | COMBO | 同时使用两者 | 选择API Key使用模式 |
| auto_refresh_statusopt | BOOLEAN | true | 自动刷新API Key状态信息 |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| status | STRING | — |
| key_status | STRING | — |