π€ Leon Qwen Image API
Qwen Image inside ComfyUI, minus the 20B download
- image
- image
- image_url
- seed
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) orqwen-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 aLoadImagetensor (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.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | A cute cat | Text description of the image to generate |
| model | COMBO | qwen-image-2 | Qwen image generation model (default: qwen-image-2) |
| aspect_ratio | COMBO | 1:1 | Aspect ratio of the generated image (default: 1:1) |
| 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 of the response data |
| imageopt | IMAGE | Required input image | |
| image_urlopt | STRING | Hosted image URL |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| image_url | STRING | β |
| seed | INT | β |