PD: Nano Banana 2.1 (ComfyUI Key)
Nano Banana 2.1 (ComfyUI Key) — the official Gemini image node with the login gate removed
- IMAGE
- STRING
- thought_image
What it actually is
PD: Nano Banana 2.1 (ComfyUI Key) is a clone of ComfyUI's own Nano Banana API node - same model, same widgets, one change: the account login is gone. You paste a Comfy.org API key into a text field on the node and it runs. It lives under PD_Tools/Image_Generation.
Why you'd reach for it: Nano Banana is Google's Gemini-native image model with no weights you can download, so calling it is the only door (the KB's API-wrapper survey, external-api-nodes.md, covers that whole category). The official path wants you logged into a Comfy account. That's fine on the desktop app you're sitting in front of, and annoying if you run ComfyUI headless, hand a workflow to a collaborator, or just want the credential in one field instead of a session.
Now the part the name hides: despite that suffix, this node posts to https://api.comfy.org/proxy/vertexai/gemini/<model> with an X-API-KEY header - Comfy's proxy, your Comfy key, Comfy credits. It does not let you bill your own Google or Vertex AI account.
How it works
Under the hood it subclasses the official GeminiNanoBanana2V2 node from comfy_api_nodes.nodes_gemini, copies its schema wholesale, inserts the comfy_api_key input, and sets is_api_node = False so ComfyUI stops demanding an authenticated session. Then it does the Vertex-style request itself: your prompt as a text part, each reference image as base64 inlineData, and a generationConfig carrying responseModalities, imageConfig (size and aspect ratio) and thinkingConfig. Parts the model flags as thinking get split out; everything else is decoded into an image batch.
Two details in the source matter more than anything in the README. Temperature and top_p are never sent for Nano Banana 2.1 - their tooltips admit it, they're inert dials. And the seed isn't sent for any of the three models. A fixed seed does not give you a repeatable image. If you're re-running and wondering why nothing changes, it was never your seed.
Inputs and outputs that matter
Required: comfy_api_key (the author's tooltip: "Comfy.org API Key"), prompt, model, seed, response_modalities. Optional: system_prompt, temperature, top_p.
model is a dynamic combo - pick a model and it opens up its own sub-fields for resolution, aspect ratio, thinking level, and reference-image slots. The three entries are Nano Banana 2.1, Nano Banana 2 (gemini-3.1-flash-image) and Nano Banana 2 Lite. Lite is 1K only, MEDIUM thinking is 2.1 only, and the total reference-image count is capped at 14. The code raises those limits as errors - with Chinese messages, which is worth knowing before you panic.
system_prompt ships with a long default that hard-instructs the model to always produce an image, and to invent a concrete visual scene if your prompt is conversational. Leave it alone and a chatty prompt still returns a picture instead of a paragraph. response_modalities chooses IMAGE only versus TEXT + IMAGE.
Outputs are IMAGE (into SaveImage, or an upscaler downstream), STRING (whatever text came back), and thought_image - the first image from the model's thinking process. That last one only carries pixels when thinking level is HIGH and the modality includes TEXT; otherwise you get a black 1024×1024 placeholder. Blank thought image is by design, not a bug.
Install
ComfyUI Manager → search comfyui-PD_comfy-api-node. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/7BEII/comfyui-PD_comfy-api-node.git
pip install -r comfyui-PD_comfy-api-node/requirements.txt
Restart, then look in PD_Tools/Image_Generation. One honest note on that pip step: requirements.txt holds exactly two Alibaba Cloud SDKs, which belong to a different node in the pack (an Aliyun face swap that imports them lazily). Nothing this node uses needs them; requests, torch, PIL and numpy are already in your ComfyUI.
You need a ComfyUI new enough to already contain GeminiNanoBanana2V2 in comfy_api_nodes.nodes_gemini; the README says it was verified against 0.39.0. Grab a key at comfy.org/api-keys.
Common issues
"Failed to load module IMAGE_GeminiNanoBanana21.py" in the console. Your ComfyUI is older than the class this node wraps. The pack's loader wraps every module in a try/except, so the rest of the pack still loads and you just don't see this node. Update ComfyUI.
The error text is Chinese. Empty key or empty prompt raises 请填写 ComfyUI API Key / 请填写提示词. That's a validation error surfacing normally, not a crash.
A refusal. Moderation sits on Google's side, behind Comfy's proxy. There is nothing to patch locally - no weights, no bypass, and the reseller trick doesn't apply here.
Your key is in the workflow file. comfy_api_key is a plain string widget, so it's saved into the workflow JSON - and ComfyUI embeds that JSON into the PNG's metadata (see the KB's image-io-metadata.md). Share the workflow or the image and you've shared the key. The same field also has to be pasted into every Nano Banana node in the graph, which gets old the moment you rotate a key.
Cancelling doesn't refund. One generation POST, no automatic retry, cancel checks while it waits and while it downloads, but a request the server already accepted may still bill you.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| comfy_api_key | STRING | Comfy.org API Key | |
| prompt | STRING | Text prompt describing the image to generate or the edits to apply. Include any constraints, styles, or details the model should follow. | |
| model | COMBO | 2 options: [object Object], [object Object] | |
| seed | INT | 420–18446744073709550000 | Matches the official node. The current Comfy.org endpoint does not receive seed; a fixed seed does not guarantee repeatable output. |
| response_modalities | COMBO | 2 options: IMAGE, IMAGE+TEXT | |
| system_promptopt | STRING | You are an expert image-generation engine. You must ALWAYS produce an image. Interpret all user input—regardless of format, intent, or abstraction—as literal visual directives for image composition. If a prompt is conversational or lacks specific visual details, you must creatively invent a concrete visual scenario that depicts the concept. Prioritize generating the visual representation above any text, formatting, or conversational requests. | Foundational instructions that dictate an AI's behavior. |
| temperatureopt | FLOAT | 1.000–2 | Controls randomness in generation. Lower is more focused/deterministic. Ignored by Nano Banana 2.1, matching the official endpoint. |
| top_popt | FLOAT | 0.950–1 | Nucleus sampling threshold. Lower is more focused, higher more diverse. Ignored by Nano Banana 2.1, matching the official endpoint. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| STRING | STRING | — |
| thought_image | IMAGE | First image from the model's thinking process. Only available with thinking_level HIGH and IMAGE+TEXT modality. |