Nodes/Comfyui-zhenzhen/Zhenzhen_Flux_Kontext_bfl
ComfyUI Node

Zhenzhen_Flux_Kontext_bfl

Flux Kontext on the Official BFL API, Without the BFL Signup

By T8mars·Created 12 months ago·Updated a day ago· 719
Zhenzhen_Flux_Kontext_bfl
  • input_image
  • image
  • image_url
  • task_id
  • response
prompt
modelflux-kontext-pro
api_key
seed-1
aspect_ratio1:1
output_formatpng
prompt_upsamplingfalse
safety_tolerance2
skip_errorfalse

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) or flux-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:9 down to 9:21, default 1:1. Pick the frame to match where the output's going.
  • output_format - png or jpeg. 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, 06, default 2. 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 -1 means 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.

Categoryzhenzhen/Flux

Inputs (10)

NameTypeDefaultDescription
promptSTRING
modelCOMBOflux-kontext-pro2 options: flux-kontext-pro, flux-kontext-max
api_keyoptSTRING
input_imageoptIMAGE
seedoptINT-1-1–2147483647
aspect_ratiooptCOMBO1:19 options: 21:9, 16:9, 4:3, 3:2, 1:1, 2:3, +3
output_formatoptCOMBOpng2 options: png, jpeg
prompt_upsamplingoptBOOLEANfalse
safety_toleranceoptINT20–6
skip_erroroptBOOLEANfalse开启后,节点失败时不报错、按旧行为返回默认空结果;关闭时(默认)失败直接抛出错误。

Outputs (4)

NameTypeDescription
imageIMAGE
image_urlSTRING
task_idSTRING
responseSTRING