Nodes/Leon's Utility and API Integration Nodes/πŸ€– Leon Nano Banana API
ComfyUI Node

πŸ€– Leon Nano Banana API

Nano Banana in ComfyUI, without a Google key

By l3ony2kΒ·Created about a year agoΒ·Updated 2 months agoΒ· 3
πŸ€– Leon Nano Banana API
  • input_images_array
  • image
  • image_url
  • seed
β—„promptMake the cat jump.β–Ί
β—„modelnano-banana-2β–Ί
β—„output_formatpngβ–Ί
β—„seed0β–Ί
β—„api_urlhttps://api.hyprlab.io/v1/images/generationsβ–Ί
β—„api_keyYOUR_API_KEY_HEREβ–Ί
β—„response_formaturlβ–Ί
β—„aspect_ratio1:1β–Ί
β—„resolution1Kβ–Ί

"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 to nano-banana-2. The nano-banana-pro variant is the only one that accepts the resolution input (1K/2K/4K); the node quietly ignores it otherwise.
  • aspect_ratio - includes match_input_image, which mirrors your reference image's ratio. That requires at least one image in input_images_array, or it's skipped with a warning in the console.
  • input_images_array - this is the IMAGE_ARRAY type, not a plain IMAGE. 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.

CategoryLeon_API

Inputs (10)

NameTypeDefaultDescription
promptSTRINGMake the cat jump.Main text prompt that influences the output generation
modelCOMBOnano-banana-2Nano Banana model: pro version supports resolution control
output_formatCOMBOpngFormat of the output image
seedINT00–18446744073709550000Random seed for reproducible results
api_urlSTRINGhttps://api.hyprlab.io/v1/images/generationsAPI URL
api_keySTRINGYOUR_API_KEY_HEREYour HyprLab API key
response_formatCOMBOurlFormat in which the response will be returned
input_images_arrayoptIMAGE_ARRAYArray of input images (up to 4). Connect Image Array Builder node output here.
aspect_ratiooptCOMBO1:1Aspect ratio of the generated image (match_input_image requires at least one image input)
resolutionoptCOMBO1K🟒 NANO-BANANA-PRO ONLY: Image resolution (1K/2K/4K)

Outputs (3)

NameTypeDescription
imageIMAGEβ€”
image_urlSTRINGβ€”
seedINTβ€”