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

πŸ€– Leon FLUX Kontext API

FLUX Kontext without the 12B download β€” instruction-based editing via API

By l3ony2kΒ·Created about a year agoΒ·Updated 2 months agoΒ· 3
πŸ€– Leon FLUX Kontext API
  • input_image
  • image
  • image_url
  • seed
β—„modelflux-kontext-proβ–Ί
β—„promptA detailed artistic sceneβ–Ί
β—„response_formaturlβ–Ί
β—„output_formatpngβ–Ί
β—„seed0β–Ί
β—„api_urlhttps://api.hyprlab.io/v1/images/generationsβ–Ί
β—„api_keyYOUR_HYPRLAB_API_KEYβ–Ί
β—„input_image_urlβ–Ί
β—„aspect_ratio1:1β–Ί
β—„num_inference_steps20β–Ί
β—„guidance3.5β–Ί

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-pro and flux-kontext-max are the hosted editing models - image + instruction, done.
  • flux-kontext-dev is 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 hard ValueError, 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_image or input_image_url - the subject you're editing.
  • aspect_ratio - includes match_input_image plus the usual ratios (Kontext is good at preserving aspect).
  • num_inference_steps and guidance - 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.

CategoryLeon_API

Inputs (12)

NameTypeDefaultDescription
modelCOMBOflux-kontext-pro3 options: flux-kontext-max, flux-kontext-pro, flux-kontext-dev
promptSTRINGA detailed artistic sceneβ€”
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_imageoptIMAGEInput image (required for flux-kontext-dev)
input_image_urloptSTRINGHosted image URL for flux-kontext image inputs
aspect_ratiooptCOMBO1:114 options: match_input_image, 1:1, 16:9, 9:16, 4:3, 3:4, +8
num_inference_stepsoptINT204–50Number of inference steps (flux-kontext-dev only)
guidanceoptFLOAT3.50–10Guidance scale (flux-kontext-dev only)

Outputs (3)

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