π€ Leon FLUX Kontext API
FLUX Kontext without the 12B download β instruction-based editing via API
- input_image
- image
- image_url
- seed
Leon FLUX Kontext API puts Black Forest Labs' Kontext editing model behind an API call, which is a genuinely good trade. Kontext is the instruction-based editor of the FLUX 1 era - you hand it an image and a sentence ("change her shirt to a red jacket", "replace the background with a forest") and it rewrites the image while keeping the subject intact, because it consumes reference images in-context rather than through adapter embeddings. Locally that means a 12B transformer and a serious GPU. Through this node it's just a prompt, an image, and a key.
The node offers the three hosted Kontext tiers - flux-kontext-max, flux-kontext-pro, and flux-kontext-dev - routed through the HyprLab API, and it's the same shared base-class machinery as the rest of the pack: POST to api.hyprlab.io/v1/images/generations, retry up to 5 times on failure, download the result, hand back an RGBA tensor.
How it works
The important distinction is how the tiers treat the input image:
flux-kontext-proandflux-kontext-maxare the hosted editing models - image + instruction, done.flux-kontext-devis the open-weights model, and the tooltip is unambiguous: input image required. The node enforces it - run dev without an image and you get a hardValueError, not a mystery failure.
The input_image socket takes a tensor and input_image_url takes a hosted URL; give it both and the base class raises rather than guess. Kontext's signature strengths apply here: character consistency across successive edits and that famous watermark-removal trick, both of which made Kontext the standard character workflow tool of its era before the license drama pushed people toward alternatives.
The inputs that matter:
model- max / pro / dev.input_imageorinput_image_url- the subject you're editing.aspect_ratio- includesmatch_input_imageplus the usual ratios (Kontext is good at preserving aspect).num_inference_stepsandguidance- dev-only, exactly like FLUX Dev's knobs; they're ignored on max and pro.
Outputs: image, image_url, seed.
Installing it
Pack-wide install, nothing special:
cd ComfyUI/custom_nodes
git clone https://github.com/l3ony2k/comfyui-leon-nodes
pip install -r requirements.txt
Restart ComfyUI, or grab it via ComfyUI Manager (search "Leon"). Minimal dependencies, zero model downloads.
Where people get burned
The dev-model-requires-an-image rule is the biggest trap - if you leave input_image disconnected and pick flux-kontext-dev, the node stops you, but it stops you after you've already confused yourself about why nothing runs. Second, Kontext is a heavily censored model at the weights level, and the API tiers inherit that: don't expect the watermark-removal party trick to survive a filter that catches content restrictions. Third, the usual HyprLab caveats - paid per generation, placeholder key means slow 401s thanks to the retry backoff, and there's essentially no public community documentation to lean on, so the tooltips and provider docs are your friends. If your whole interest is "local Kontext without the VRAM", this node is the short path.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | flux-kontext-pro | 3 options: flux-kontext-max, flux-kontext-pro, flux-kontext-dev |
| prompt | STRING | A detailed artistic scene | β |
| response_format | COMBO | url | 2 options: url, b64_json |
| output_format | COMBO | png | 3 options: png, jpeg, webp |
| seed | INT | 00β18446744073709550000 | β |
| api_url | STRING | https://api.hyprlab.io/v1/images/generations | β |
| api_key | STRING | YOUR_HYPRLAB_API_KEY | β |
| input_imageopt | IMAGE | Input image (required for flux-kontext-dev) | |
| input_image_urlopt | STRING | Hosted image URL for flux-kontext image inputs | |
| aspect_ratioopt | COMBO | 1:1 | 14 options: match_input_image, 1:1, 16:9, 9:16, 4:3, 3:4, +8 |
| num_inference_stepsopt | INT | 204β50 | Number of inference steps (flux-kontext-dev only) |
| guidanceopt | FLOAT | 3.50β10 | Guidance scale (flux-kontext-dev only) |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| image_url | STRING | β |
| seed | INT | β |