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

πŸ€– Leon FLUX 2 Image API

FLUX 2 Pro, Max and Flex from a ComfyUI node β€” the multi-image workhorse

By l3ony2kΒ·Created about a year agoΒ·Updated 2 months agoΒ· 3
πŸ€– Leon FLUX 2 Image API
  • input_images_array
  • image
  • image_url
  • seed
β—„model_choiceFLUX 2 Proβ–Ί
β—„promptA stunning artistic photoβ–Ί
β—„response_formaturlβ–Ί
β—„output_formatpngβ–Ί
β—„seed0β–Ί
β—„api_urlhttps://api.hyprlab.io/v1/images/generationsβ–Ί
β—„api_keyYOUR_HYPRLAB_API_KEYβ–Ί
β—„aspect_ratio1:1β–Ί
β—„resolution1 MPβ–Ί
β—„steps30β–Ί
β—„guidance3.5β–Ί

Leon FLUX 2 Image API is the node for when "local FLUX on my 3060" isn't good enough. It wraps Black Forest Labs' FLUX 2 line - Pro, Max, and Flex - through the HyprLab API and hands you back a ComfyUI-ready image tensor. If you've been on the FLUX 1.1 train, FLUX 2's big selling point is that it takes multiple input images natively and reasons over them together, and this node is built around exactly that.

FLUX 2 isn't a local-model situation. It's a hosted API product - you pay per generation, you get an image URL back, and the node downloads it and converts it to an RGBA tensor so the rest of your graph never knows the difference. There's no checkpoint to hunt down and no VRAM to manage, which is the entire appeal: the FLUX 2 workflow in ComfyUI is "write a prompt, maybe feed it some images, hit run."

How it works

The node POSTs a JSON payload to https://api.hyprlab.io/v1/images/generations (that's the api_url default - you can repoint it) with a Bearer token, then handles the response through the pack's shared base class: retry up to 5 times with exponential backoff, download the image, convert to RGBA. Outputs are image, image_url, and seed.

The inputs that actually matter:

  • model_choice - FLUX 2 Pro, FLUX 2 Max, or FLUX 2 Flex. Pro is the default and the generalist.
  • input_images_array - the multi-image input. The node caps it: up to 8 images for Pro, up to 10 for Max and Flex, and it preserves their original dimensions. This is the feature. Chain it from the pack's Image Array Builder.
  • aspect_ratio and resolution - pick from match_input_image, the usual ratios, and resolutions from 0.5 MP to 4 MP.
  • steps and guidance - these are FLUX 2 Flex only (the tooltips say so, and the code only adds them for Flex). Flex is the fast/cheap one; if you're on Pro or Max, changing them does nothing.

One subtle thing: steps and guidance have defaults of 30 and 3.5 that get added to the payload only for Flex. On Pro/Max they're ignored entirely, so don't chase weird settings wondering why output doesn't change - that's expected.

Installing it

Standard pack 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. Requirements are minimal (tenacity, requests, pillow, torch, numpy) and there are no model files - it's all API calls.

Where people get burned

The API key is the usual suspect: the default YOUR_HYPRLAB_API_KEY placeholder won't generate anything but a slow 401. And because the retry logic backs off up to 5 times, that bad-key failure takes a while to surface - check your console output if a run hangs. Second, the HyprLab route means this is a paid service with essentially no public community footprint - don't expect a big Reddit thread troubleshooting it; the evidence base is thin and you'll be reading provider docs. Finally, remember multi-image mode is the reason to pick this node over the older FLUX 1.1 node in the same pack: if you're remixing references, you want the FLUX 2 one.

CategoryLeon_API

Inputs (12)

NameTypeDefaultDescription
model_choiceCOMBOFLUX 2 Pro3 options: FLUX 2 Pro, FLUX 2 Max, FLUX 2 Flex
promptSTRINGA stunning artistic photoβ€”
response_formatCOMBOurl2 options: url, b64_json
output_formatCOMBOpng3 options: png, jpeg, webp
seedINT00–18446744073709550000β€”
api_urlSTRINGhttps://api.hyprlab.io/v1/images/generationsβ€”
api_keySTRINGYOUR_HYPRLAB_API_KEYβ€”
input_images_arrayoptIMAGE_ARRAYArray of input images for FLUX 2 models. Connect Image Array Builder node output here.
aspect_ratiooptCOMBO1:1Aspect ratio for generated image
resolutionoptCOMBO1 MPImage resolution
stepsoptINT301–50Number of steps (FLUX 2 Flex only)
guidanceoptFLOAT3.51.5–10Guidance scale (FLUX 2 Flex only, range: 1.5-10)

Outputs (3)

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