π€ Leon Official Nano Banana π
The Nano Banana node that's actually official
- input_image
- image_array
- image
- description
- seed
If there's one node in this whole pack you'd actually fight someone for, it's this one. Nano Banana - Google's Gemini image model, the one the community nickname stuck to hard after it crushed the edit benchmarks in mid-2025 - is closed-weights and API-only, so the only way to get it into ComfyUI is through an API node. And this is the version that talks to Google directly with your own Gemini key, no aggregator in between.
The pack has two Nano Banana routes, and the difference matters. Leon_Nano_Banana_API_Node goes through HyprLab, a third-party aggregator, with a single shared key. This Leon_Official_Nano_Banana_Node calls generativelanguage.googleapis.com/v1beta natively with x-goog-api-key auth. Direct key, direct billing, no reseller margin, no "why does this model string 404" mysteries. It's also the version that shows what the model actually is: a text-and-image conversation, where the image model returns an image and can describe it.
How it works
The node builds a Gemini contents request - your prompt as a text part, plus any reference images as inlineData parts - and sends it to the generateContent endpoint. The generationConfig carries responseModalities (IMAGE only, or TEXT+IMAGE) and an imageConfig with your chosen aspectRatio and imageSize. The reply is parsed for both text parts (captions/descriptions) and the inlineData image, which gets converted into a ComfyUI RGBA tensor. Retry logic matches the pack's other nodes: exponential backoff, up to five attempts, and a hard stop on HTTP 400s so you don't burn retries on a bad request.
Inputs that matter
model- defaults togemini-3.1-flash-image-preview, withgemini-3-pro-image-previewandgemini-2.5-flash-imagein the dropdown.custom_modeloverrides any of them.response_modalities-IMAGE_ONLYis the default and returns just the picture. Switch toTEXT_AND_IMAGEand thedescriptionoutput fills with the model's own write-up of the image. That's a genuinely handy free caption.image_size- 1K/2K/4K. The tooltip nudges you about uppercase K for a reason:4kwon't parse like4Kdoes.image_array- up to 14 reference images via the pack's Image Array Builder. This is where editing shines: stack a few shots of a subject and the model keeps identity far better than most open editors.
Outputs: image (tensor β SaveImage), description (STRING, only populated in TEXT_AND_IMAGE mode), and seed.
Installing
Same pack, same routine - ComfyUI Manager (search Leon) or:
cd ComfyUI/custom_nodes/
git clone https://github.com/l3ony2k/comfyui-leon-nodes comfyui-leon-nodes
pip install -r requirements.txt
Restart, grab a Gemini API key from Google AI Studio, and drop it in. Nothing downloads, nothing local - this is pure cloud, and it costs per call.
Common issues
The 400s are the thing to learn: a wrong aspect_ratio (only the listed ones), a bogus custom_model, or a lowercase k in image_size all come back as a 400 that the node won't retry. The console prints the full Google error body, which is where the answer always is. And if you're coming from the HyprLab node with a nano-banana-2 model string in your head - stop. This node's enums are the actual Gemini model IDs, not the aggregator's nicknames. Paste the right key and keep IMAGE_ONLY on unless you actually want the description; the text mode costs more tokens for no visible image gain.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | A beautiful painting of a nano banana dish in a fancy restaurant | Text prompt for image generation |
| model | COMBO | gemini-3.1-flash-image-preview | Nano Banana model variant |
| api_key | STRING | YOUR_GEMINI_API_KEY | Your Google Gemini API key |
| seed | INT | 00β18446744073709550000 | Random seed for reproducible results |
| aspect_ratioopt | COMBO | 1:1 | Aspect ratio of the output image |
| image_sizeopt | COMBO | 1K | Output resolution: 1K (default), 2K, or 4K. Must use uppercase K. |
| response_modalitiesopt | COMBO | IMAGE_ONLY | TEXT_AND_IMAGE returns descriptive text + image. IMAGE_ONLY returns image only. |
| input_imageopt | IMAGE | Optional reference image for editing | |
| image_arrayopt | IMAGE_ARRAY | Optional array of reference images (up to 14). Connect Image Array Builder. | |
| custom_modelopt | STRING | Override model name with a custom string |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| description | STRING | β |
| seed | INT | β |