Nodes/Google Nano/google nano
ComfyUI Node

google nano

Run Google's Nano Banana inside ComfyUI — no GPU, just an OpenRouter key

By annewj023·Created about a year ago·Updated 12 months ago· 11
google nano
  • image1
  • image2
  • image3
  • image4
  • image
  • status
  • key_status
api_key_main
api_key_2
api_key_3
api_key_4
prompt
file_path
site_url
site_name
modelgoogle/gemini-2.5-flash-image-preview:free
max_concurrent3
scheduling_moderound_robin
enable_parallelfalse
max_retries3
enable_detailed_logstrue
key_management_mode同时使用两者
auto_refresh_statustrue

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 optional api_key_2/3/4 slots, but the README's recommendation for more than a couple of keys is key_management_mode set to use the config-file key mode: keys live in config.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 the key_status output.
  • image1 - required; image2image4 are optional reference images. You need at least one.
  • prompt - for single-image runs. Give it a path in file_path (CSV or Excel with a prompt column, Chinese paths fine) and it batch-runs the whole file instead, which is this pack's real selling point.
  • model - dropdown, default google/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_concurrent defaults 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 reading config.json and 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.

CategoryOpenRouter

Inputs (20)

NameTypeDefaultDescription
api_key_mainSTRING主API Key(必填)
image1IMAGE
api_key_2optSTRINGAPI Key 2(可选)
api_key_3optSTRINGAPI Key 3(可选)
api_key_4optSTRINGAPI Key 4(可选)
promptoptSTRING单图生成的提示词
file_pathoptSTRING批量处理的CSV/Excel文件路径
site_urloptSTRING网站URL(可选)
site_nameoptSTRING网站名称(可选)
modeloptCOMBOgoogle/gemini-2.5-flash-image-preview:free选择要使用的AI模型
max_concurrentoptINT31–10最大并发任务数量(1-10)
scheduling_modeoptCOMBOround_robinAPI Key调度模式:轮换/随机/加权
enable_paralleloptBOOLEANfalse启用并行模式(同时使用多个API Key)
max_retriesoptINT30–10API调用失败时的最大重试次数
enable_detailed_logsoptBOOLEANtrue启用详细的任务执行日志
key_management_modeoptCOMBO同时使用两者选择API Key使用模式
auto_refresh_statusoptBOOLEANtrue自动刷新API Key状态信息
image2optIMAGE
image3optIMAGE
image4optIMAGE

Outputs (3)

NameTypeDescription
imageIMAGE
statusSTRING
key_statusSTRING