Flux Kontext Pro (BFL)
Edit photos by describing them, no mask, no Local Latent cache
- config
- IMAGE
Flux Kontext Pro (BFL) is the instruction-based editor from Black Forest Labs, delivered through the API. Feed it an image and a sentence - "change the shirt to red," "put this person in a desert," "swap the background" - and it returns the edited image. No mask, no inpaint region, no denoise dial. That's the deal with Kontext: reference images go into the model's context rather than being injected as adapter embeddings, which is why it holds a subject so well across successive edits.
The reason you'd use the API version instead of the local Kontext Dev weights is the same reason you use any node in this pack: no 12B model in VRAM, no non-commercial-license paperwork, and access to the Pro tier, which never leaves the API. Kontext Pro is BFL's full-fidelity editor and it's genuinely good at the "change this, keep everything else about this person" class of edits that local pipelines still stumble on.
How it works
You pass a prompt plus up to four reference images (base64 strings, via the pack's Image to Base64 (BFL) node) to the flux-kontext-pro endpoint. The node POSTs, gets a task ID, polls get_result?id=... every 5 seconds, and returns a single IMAGE tensor when ready. Because the model takes the whole image into context and emits a new whole image, unmasked regions come back close but not bit-identical - that's the difference from mask-based editing, and it's a real one for pixel-perfect work.
The inputs that matter
- prompt - the edit instruction. This is the whole game; describe what changes and what stays.
- input_image (plus optional input_image_2/3/4) - up to four references. That's how you get multi-image edits: "keep person A's face, person B's outfit, this setting."
- aspect_ratio -
none(default, keep whatever the image implies) or a fixed ratio like16:9,1:1,9:21. Set it only if you want the output's frame to change. - prompt_upsampling - lets BFL expand your prompt internally. Usually unnecessary; Kontext is good at short, direct instructions.
- safety_tolerance - 0–6, default 2. Moderation strictness. Bounce a request with 0 and it'll get moderated; push it to 6 if you're confident the content is fine but the filter is twitchy.
- output_format - jpeg or png, default png here (editing, so lossless is the sane default).
- Optional seed, webhooks, and a
configoverride.
Output: one IMAGE tensor → SaveImage.
Installing it
Standard for this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/gelasdev/ComfyUI-FLUX-BFL-API.git
Restart, set your key in config.ini or via Flux Config (BFL), and you're done. No downloads beyond the repo - the pack's only declared dependency is torch, already present.
Where people get burned
- Expecting a mask. There isn't one. Kontext regenerates the whole image. If you need the rest of the frame bit-identical, this is the wrong tool - that's Flux Erase or mask-based inpainting's job.
- Black image output. The pack's graceful failure: moderation hit, API error, or polling timed out (~200s ceiling). Check the
[BFL]console logs - each request prints a curl equivalent you can replay by hand. - Off-the-shelf edit quality. Kontext's known weakness list is real: complex spatial instructions, hands, and small text are hit or miss. Frame your prompt around what changes and what must not.
Honest take: for one-off edits on a machine with the VRAM for local Kontext, local is cheaper. Kontext Pro earns its API price when you want the strongest tier, the multi-image context, or you're running on a machine that can't hold the model.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| input_image | STRING | — | |
| aspect_ratio | COMBO | none | 10 options: none, 21:9, 16:9, 3:2, 4:3, 1:1, +4 |
| prompt_upsampling | BOOLEAN | false | — |
| safety_tolerance | INT | 20–6 | — |
| output_format | COMBO | png | 2 options: jpeg, png |
| seedopt | INT | -1 | — |
| input_image_2opt | STRING | — | |
| input_image_3opt | STRING | — | |
| input_image_4opt | STRING | — | |
| webhook_urlopt | STRING | — | |
| webhook_secretopt | STRING | — | |
| configopt | BFL_CONFIG | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |