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

πŸ€– Leon Qwen Image API

Qwen Image inside ComfyUI, minus the 20B download

By l3ony2kΒ·Created about a year agoΒ·Updated 2 months agoΒ· 3
πŸ€– Leon Qwen Image API
  • image
  • image
  • image_url
  • seed
β—„promptA cute catβ–Ί
β—„modelqwen-image-2β–Ί
β—„aspect_ratio1:1β–Ί
β—„output_formatpngβ–Ί
β—„seed0β–Ί
β—„api_urlhttps://api.hyprlab.io/v1/images/generationsβ–Ί
β—„api_keyYOUR_API_KEY_HEREβ–Ί
β—„response_formaturlβ–Ί
β—„image_urlβ–Ί

The Qwen-Image family is Alibaba's answer to the big closed editors: a 20B architecture that became the open editing standard, all Apache 2.0, with Qwen-Image-2.0 later collapsing to a 7B unified generation-plus-editing model. Locally, running any of it means downloading tens of gigabytes and babysitting VRAM. This node skips all of that: Leon_Qwen_Image_API_Node calls qwen-image-2 or qwen-image-2-pro through the HyprLab aggregator and returns a finished image to your graph. The weights stay on Alibaba's servers; you just get the picture.

Before the open-weights crowd gets defensive: no, this isn't the local Qwen-Image experience, and it isn't pretending to be. It's the API flavor - qwen-image-2 is a newer generation than the open 20B checkpoints the KB tracks, and you're paying per call. If your job is "I need Qwen's text rendering and editing strength inside a ComfyUI workflow today, on a GPU that can't hold a 20B model," this is the pragmatic middle ground.

How it works

Standard pack plumbing under the hood: the shared HyprLabImageGenerationNodeBase builds an OpenAI-style payload (model, prompt, aspect_ratio, response_format, output_format), POSTs it to https://api.hyprlab.io/v1/images/generations with a Bearer token, retries on failures with exponential backoff (five attempts), and converts the returned image to an RGBA tensor. Nothing here runs locally - it's pure HTTP plus a Pillow decode.

Inputs that matter

  • model - qwen-image-2 (default) or qwen-image-2-pro. The pro tier is the heavier sibling; if your plan's default works, the speed difference is usually not worth paying for.
  • aspect_ratio - a tight five: 1:1, 16:9, 9:16, 4:3, 3:4. No 21:9 here, so crop expectations accordingly.
  • image / image_url - optional in the schema but the tooltip calls the tensor "Required input image" for a reason: Qwen Image's real strength is editing and regeneration, not blank-canvas novelty. Feed it a LoadImage tensor (or a hosted URL - the node refuses to accept both at once) and describe the change.

Outputs are the pack standard: image, image_url, seed.

Installing

Same pack as every Leon node - ComfyUI Manager (search Leon) or clone:

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

Restart, drop a HyprLab key in api_key. Light dependencies (tenacity, requests, pillow, torch, numpy), no model downloads.

Common issues

The usual API-node suspects: a default YOUR_API_KEY_HERE key, and the "provide either a tensor or a URL, not both" error if you wire LoadImage into image while something else fills image_url. When the edit comes back weak, the fix is usually prompt structure - Qwen Image family models respond well to explicit "keep X, change Y" phrasing, the same instruction-editing discipline the community converged on with Qwen-Edit. And remember it's metered: compose the reference and the instruction before you hit run, because each failure-and-retry cycle still costs a call.

CategoryLeon_API

Inputs (10)

NameTypeDefaultDescription
promptSTRINGA cute catText description of the image to generate
modelCOMBOqwen-image-2Qwen image generation model (default: qwen-image-2)
aspect_ratioCOMBO1:1Aspect ratio of the generated image (default: 1:1)
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 of the response data
imageoptIMAGERequired input image
image_urloptSTRINGHosted image URL

Outputs (3)

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