Nodes/Leon's Utility and API Integration Nodes/πŸ€– Leon Image Array Builder
ComfyUI Node

πŸ€– Leon Image Array Builder

Turn up to 8 images into the IMAGE_ARRAY the API nodes demand

By l3ony2kΒ·Created about a year agoΒ·Updated 2 months agoΒ· 3
πŸ€– Leon Image Array Builder
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image_array
β—„output_modebase64β–Ί
β—„api_keyβ–Ί

Leon Image Array Builder is the node you'll wire up without thinking about it, and then wonder how the pack works without it. Almost every image-generation node in comfyui-leon-nodes that accepts input images - the Nano Banana nodes, FLUX 2, GPT-Image, Grok - takes a special IMAGE_ARRAY type, not plain IMAGE sockets. ComfyUI won't let you drag a LoadImage wire onto those inputs. This node is the adapter: you plug in up to 8 images and it emits one image_array that the API nodes can actually swallow.

It's also doing real work under the hood, not just bundling tensors. The multi-image API models don't want raw tensors - they want images they can send over HTTP. So the Array Builder converts each input to either a base64 data URI (a self-contained data:image/png;base64,... string) or a hosted URL, depending on your output_mode.

How it works

Two modes, one dropdown:

  • output_mode = base64 (default) - each image becomes a base64 data URI, preserving original dimensions. Zero extra credentials needed. This is the mode you want for the Tuzi Nano Banana nodes, which turn those data URIs back into file uploads for their multipart edit endpoint.
  • output_mode = url - each image is uploaded to HyprLab (api.hyprlab.io/v1/uploads) and the array comes back as hosted URLs. This mode requires an API key - the node raises if you try url mode without one - and it's the mode you want for providers that prefer URLs over giant base64 blobs.

The inputs are image_1 through image_8 - eight optional IMAGE sockets, so the array is built in order and skips anything left disconnected. At least one image is mandatory (it errors otherwise). The output is a single image_array of type IMAGE_ARRAY.

One subtlety: for base64 mode, the node takes the first frame of a batched tensor ([0]), so a batch of 4 frames in one IMAGE socket becomes just the first frame - you genuinely need separate image_1/image_2/... inputs for multiple images. That trips people up more than anything else in this node.

Installing it

Pack-wide install:

cd ComfyUI/custom_nodes
git clone https://github.com/l3ony2k/comfyui-leon-nodes
pip install -r requirements.txt

Restart ComfyUI, or install "ComfyUI Leon Nodes" via ComfyUI Manager. Light dependencies, no models.

Where people get burned

The first-frame-of-a-batch gotcha above is the classic one - a batched tensor doesn't become multiple array items. Second: trying url mode without a HyprLab API key gets you an immediate error, and the URLs it produces live in HyprLab's cloud, so they're neither private nor permanent. Third, the cap: the Nano Banana nodes will only use the first 4 entries of the array, and FLUX 2 caps at 8–10 depending on model, so a bigger array is silently trimmed downstream. The mental model to hold: this node is the pack's universal input adapter, and almost every multi-image workflow in the pack starts here.

CategoryLeon_Utils

Inputs (10)

NameTypeDefaultDescription
output_modeCOMBObase64Output format: 'base64' for data URIs, 'url' for uploaded image URLs
api_keyoptSTRINGHyprLab API key (required when output_mode is 'url')
image_1optIMAGEFirst image in the array
image_2optIMAGESecond image in the array
image_3optIMAGEThird image in the array
image_4optIMAGEFourth image in the array
image_5optIMAGEFifth image in the array
image_6optIMAGESixth image in the array
image_7optIMAGESeventh image in the array
image_8optIMAGEEighth image in the array

Outputs (1)

NameTypeDescription
image_arrayIMAGE_ARRAYβ€”