Zhenzhen_Flux_Kontext_bfl
Flux Kontext on the Official BFL API, Without the BFL Signup
- input_image
- image
- image_url
- task_id
- response
Flux Kontext is Black Forest Labs' answer to "keep the subject, change the world around it." You hand it a reference image of a product, a person, or a thing, describe a scene, and it drops that subject into the scene with the subject's identity preserved. Locally you'd approximate this with IP-Adapter plus a lot of praying; Kontext does it as a first-class model - but it's a closed, API-only model. This node is the "bfl" variant: it routes through Black Forest Labs' official API, resold through the Comfly proxy, so you don't have to open your own BFL account or juggle another dashboard.
It's the API-proxy trade in miniature: no GPU burn, no model downloads, and per-call pricing that the README quotes around 0.096 yuan for flux-kontext-pro and roughly double for flux-kontext-max. If you've ever wanted Kontext without committing to a BFL contract, this is the on-ramp.
How it works
Your prompt and optional reference image get base64-encoded and sent to the proxy, which forwards to BFL's Kontext API. The node blocks until the image comes back, then hands you both the tensor and the hosted URL. Nothing runs locally except the HTTP calls.
The inputs that matter
- model -
flux-kontext-pro(default) orflux-kontext-max. Max is the bigger, pricier model; pro is the sensible default. - input_image - the subject reference. This is the whole point of Kontext: one image in, a scene around it out.
- aspect_ratio - nine choices from
21:9down to9:21, default1:1. Pick the frame to match where the output's going. - output_format -
pngorjpeg. PNG unless you need to keep file size down. - prompt_upsampling - off by default. Flip it on and the API expands your prompt for you; handy if your prompt's thin.
- safety_tolerance - a real BFL API parameter,
0–6, default2. Higher tolerates more. This is one of the few Comfly nodes where the proxy passes an official param through rather than inventing its own, so treat it as BFL's dial, not the pack's. - seed - default
-1means random; set a value to lock results.
Outputs are image (IMAGE), image_url (STRING - the hosted copy), and response (STRING - raw JSON). Note this node is flagged as an output node, so it can display directly in the graph; the image_url is worth keeping regardless because that's your permanent copy.
Install
Manager → search Comfyui_Comfly, or:
cd ComfyUI/custom_nodes
git clone https://github.com/ainewsto/Comfyui_Comfly
Restart, then drop your key from ai.comfly.chat into Comflyapi.json or the node's api_key field. The requirements.txt pulls aiohttp/requests/Pillow/numpy plus the usual torch/transformers you already have - no weights to fetch.
Where people get burned
The obvious one: this is a paid API, and "max" doubles your per-call cost without always doubling the visible quality. Try pro first. Also remember Kontext isn't a free-from editor - it's a reference model, so wildly mismatched subject/scene combos (a photo-real cat in a watercolor castle) can come back looking off; describe the scene and let the model do its thing rather than over-prompting. And because this is a reseller front for BFL, occasional failures show up as an error in response rather than a clean node message - check that string before you retry.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| model | COMBO | flux-kontext-pro | 2 options: flux-kontext-pro, flux-kontext-max |
| api_keyopt | STRING | — | |
| input_imageopt | IMAGE | — | |
| seedopt | INT | -1-1–2147483647 | — |
| aspect_ratioopt | COMBO | 1:1 | 9 options: 21:9, 16:9, 4:3, 3:2, 1:1, 2:3, +3 |
| output_formatopt | COMBO | png | 2 options: png, jpeg |
| prompt_upsamplingopt | BOOLEAN | false | — |
| safety_toleranceopt | INT | 20–6 | — |
| skip_erroropt | BOOLEAN | false | 开启后,节点失败时不报错、按旧行为返回默认空结果;关闭时(默认)失败直接抛出错误。 |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| image_url | STRING | — |
| task_id | STRING | — |
| response | STRING | — |