Nodes/ComfyUI-Nerapi/Nano-Banana
ComfyUI Node

Nano-Banana

2K/4K Renders Through a Reseller's API Key

By Guguniaoer·Created 2 months ago·Updated 2 months ago· 0
Nano-Banana
  • 图片1
  • 图片2
  • 图片3
  • 图片4
  • 图片5
  • 图片6
  • 图片7
  • 图片8
  • 图像
密钥
提示词
模型nano-banana-pro
比例1:1
清晰度1K
接口地址https://nerapi.com/v1
轮询间隔3.0
超时秒数300

Nano-Banana is Google's closed image family - Pro (Gemini 3 Pro Image: native 4K output and a "thinking mode" that reasons about your prompt) and 2 (Gemini 3.1 Flash, the speed-versus-price hybrid). Neither has open weights, so if you want one inside ComfyUI, an API is the only door. The official one is ComfyUI's Partner Nodes on prepaid credits. This node takes the other route: NerapiNanoBanana calls the models through nerapi.com, a third-party Chinese gateway, charged per image from an account balance.

Nothing runs locally. No weights, no VRAM, no downloads. What you actually get - and the reason to pick this node over the pack's GPT-Image-2 one - is a real 模型 (model) choice and a 清晰度 (clarity) selector: 1K, 2K, or 4K. If you're here, that resolution control is probably the point; Nano-Banana Pro's 4K native output is its headline feature, and GPT-Image-2 won't give you it at all.

How it works

Same wrapper machinery as the rest of the pack: submit a job to POST /v1/api/generate, poll GET /v1/api/result?id=... until the status flips to succeeded, download the image, and return a normal IMAGE tensor. The node adds aspectRatio and imageSize to the payload the gateway understands. That's the whole mechanism - the interesting part is the inputs, because Google's lineup is fiddly about which parameters are allowed together.

Inputs and outputs that matter

Required: 密钥 (your nerapi sk-... key), 提示词 (the prompt), 模型 (model), 比例 (ratio), 清晰度 (1K/2K/4K).

  • 模型 defaults to nano-banana-pro; nano-banana-2 is the other pick. Pro is the quality play, 2 the faster and cheaper one.
  • 比例 has 15 options: the usual auto, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 5:4, 4:5, 21:9 - plus 1:4, 4:1, 1:8, 8:1, which are nano-banana-2 only. Pro flat-out rejects those. Nice touch: a small front-end extension in this pack hides the four extra ratios from the dropdown the moment you switch to Pro, so you can't even pick a combo the API will bounce.

Optional, same as the sibling node: 图片1–图片8 reference images for image-to-image, 接口地址 (default https://nerapi.com/v1), 轮询间隔 (poll interval, default 3s), 超时秒数 (timeout, default 300s).

Output: 图像 (IMAGE). Straight to Preview or Save Image. Want to test the API before ComfyUI? The pack's test_api.py runs standalone:

pip install requests
python test_api.py --key sk-你的key --model nano-banana-pro --size 2K --ratio 16:9

Installation

Search "ComfyUI-Nerapi" in ComfyUI Manager, or clone it:

cd ComfyUI/custom_nodes
git clone https://github.com/Guguniaoer/ComfyUI-Nerapi.git
cd ComfyUI-Nerapi
pip install -r requirements.txt

Restart ComfyUI; the node lives under Nano-Banana / GPT-Image. Dependencies are just requests, Pillow, numpy - no model files, nothing heavy.

Common issues

  • Balance = 0 fails everything - including reference-image uploads. The gateway needs public URLs rather than base64, so the node uploads your 图片 inputs to nerapi's image host, and those links expire after ~6 hours. Both generation and upload spend balance.
  • 400 errors usually mean a ratio/clarity combo the model rejects - Pro plus 1:4, for instance. The dropdown filter helps, but the authoritative list is in the nerapi dashboard.
  • 401 is a bad key; jobs that keep dying at 300s probably need a bigger 超时秒数.
  • All labels are Chinese (密钥 = key, 提示词 = prompt, 模型 = model, 比例 = ratio, 清晰度 = clarity). That's by design, not a bug.

The honest caveat

This is a reseller-gateway wrapper with near-zero footprint in the English community - "nerapi" has no real Reddit presence and the README is Chinese-first. It's MIT and small enough to skim, which you should: any node that holds your API key and phones home by design deserves a once-over, and the official Partner Nodes remain the safer default if you want a vetted path to Nano Banana. But if you're already in the nerapi ecosystem - or just want Nano-Banana's 2K/4K without setting up a Google Cloud billing account - this is a competent, no-frills way to put it in your graph.

CategoryNano-Banana / GPT-Image

Inputs (16)

NameTypeDefaultDescription
密钥STRING
提示词STRING
模型COMBOnano-banana-pro2 options: nano-banana-pro, nano-banana-2
比例COMBO1:115 options: auto, 1:1, 16:9, 9:16, 4:3, 3:4, +9
清晰度COMBO1K3 options: 1K, 2K, 4K
图片1optIMAGE
图片2optIMAGE
图片3optIMAGE
图片4optIMAGE
图片5optIMAGE
图片6optIMAGE
图片7optIMAGE
图片8optIMAGE
接口地址optSTRINGhttps://nerapi.com/v1
轮询间隔optFLOAT3.01–30
超时秒数optINT30030–1800

Outputs (1)

NameTypeDescription
图像IMAGE