π€ Leon Nano Banana API
Nano Banana in ComfyUI, without a Google key
- input_images_array
- image
- image_url
- seed
"Nano Banana" is the community nickname for Google's Gemini image model - the one that rewrote the edit-image benchmark when it dropped and still runs circles around most local editing stacks. It's also closed-weights and API-only, which is exactly why this node exists. Leon_Nano_Banana_API_Node puts Nano Banana in your ComfyUI graph without you ever holding a Google Cloud key: you point it at an aggregator endpoint (HyprLab by default), paste one API key, and pick a nano-banana-* model from a dropdown.
This is the third-party-key route. If you have a Google AI Studio key, skip straight to the pack's Leon_Official_Nano_Banana_Node - it talks to Google's native API directly and is the cleaner path. This one is for when you'd rather deal with one aggregator account than a second vendor.
How it works
Every image node in this pack inherits from a shared HyprLabImageGenerationNodeBase. That base does one job: build an OpenAI-style payload, POST it to https://api.hyprlab.io/v1/images/generations with a Bearer token, then turn whatever comes back into a ComfyUI IMAGE tensor. It retries with exponential backoff (up to five attempts, via tenacity), so transient 500s from the upstream provider usually resolve themselves. The model string you select - nano-banana-2-lite, nano-banana-2, nano-banana-pro, nano-banana - is sent through to HyprLab, which routes it to the actual provider. You're trusting that middleman with your prompts and your credits, so treat the key accordingly: it's a paid service, and every generation is a metered call, not a free local render.
Inputs that matter
Most of the fields are self-explanatory (prompt, seed, api_key, output_format), so here are the three that trip people up:
model- defaults tonano-banana-2. Thenano-banana-provariant is the only one that accepts theresolutioninput (1K/2K/4K); the node quietly ignores it otherwise.aspect_ratio- includesmatch_input_image, which mirrors your reference image's ratio. That requires at least one image ininput_images_array, or it's skipped with a warning in the console.input_images_array- this is theIMAGE_ARRAYtype, not a plainIMAGE. Feed it from the pack's own Leon Image Array Builder node (up to four images for this one), which serializes them to base64 data URIs.
The three outputs are the standard pack signature: image (RGBA tensor - wire it to SaveImage or PreviewImage), image_url (the hosted URL or a base64 data URI, depending on response_format), and seed (handy for reproducing a result you like).
Installing
Via ComfyUI Manager, search for Leon (the pack is "Leon's Utility and API Integration Nodes"). Or clone it yourself:
cd ComfyUI/custom_nodes/
git clone https://github.com/l3ony2k/comfyui-leon-nodes comfyui-leon-nodes
pip install -r requirements.txt
Then restart ComfyUI. The requirements are light - tenacity, requests, pillow, torch, numpy - so there's nothing heavy to compile and no model files to download. All the weight lives on someone else's server.
Common issues
The usual first failure is the default api_key still sitting at YOUR_API_KEY_HERE. After that, look at the console: the node logs the full request URL and payload (base64 truncated), so a 4xx response usually tells you exactly what the aggregator rejected - often a model string your HyprLab plan doesn't include, or an aspect ratio the model can't do. If you get a timeout on a heavy 4K nano-banana-pro call, the retry loop is working as intended; give it the five attempts. And don't forget that editing is the star of this model family - hook up the Image Array Builder and describe the change, not a fresh scene.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Make the cat jump. | Main text prompt that influences the output generation |
| model | COMBO | nano-banana-2 | Nano Banana model: pro version supports resolution control |
| output_format | COMBO | png | Format of the output image |
| seed | INT | 00β18446744073709550000 | Random seed for reproducible results |
| api_url | STRING | https://api.hyprlab.io/v1/images/generations | API URL |
| api_key | STRING | YOUR_API_KEY_HERE | Your HyprLab API key |
| response_format | COMBO | url | Format in which the response will be returned |
| input_images_arrayopt | IMAGE_ARRAY | Array of input images (up to 4). Connect Image Array Builder node output here. | |
| aspect_ratioopt | COMBO | 1:1 | Aspect ratio of the generated image (match_input_image requires at least one image input) |
| resolutionopt | COMBO | 1K | π’ NANO-BANANA-PRO ONLY: Image resolution (1K/2K/4K) |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| image_url | STRING | β |
| seed | INT | β |