Flux Klein 9B (BFL)
This node just phones BFL's API
- image_1
- image_2
- image_3
- image_4
- image
The name makes it look like a model loader, but the node is a lie in the best way. Flux Klein 9B (BFL) doesn't run FLUX.2 Klein locally - it's a thin wrapper around Black Forest Labs' hosted API. No 13GB model to download, no 24GB VRAM ceiling, no UNET loader anywhere in the graph. What it costs instead is an API key and real money per image, so it's a trade you make on purpose.
Why reach for it at all? Klein 9B is the strongest consumer-tier Flux 2 - the "main rival to Z-Image" for editing, per the modidex flux-2 panel - but it wants serious hardware and it's non-commercial licensed anyway. If you want Klein's output for a project without babysitting a local install, this node gives it to you as a plain IMAGE tensor that drops straight into your ComfyUI graph. It also accepts up to four reference images, which is the multi-reference consistency trick that makes Flux 2 worth using in the first place.
How it works
It's a request–poll–download cycle under the hood. When you hit Generate, the node base64-encodes any image inputs, POSTs your prompt to api.bfl.ai/v1/flux-2-klein-9b, then polls a polling_url once a second for up to five minutes until the image is ready. Ready image downloads, gets converted to a tensor, and lands on the image output. Give it a finetune_id and it silently switches to the flux-2-klein-9b-finetuned endpoint instead.
The inputs that matter:
- prompt - plain text, same one you'd type into BFL's playground.
- width / height - 256–4096, snapped to multiples of 32, 1024 default.
- api_key - leave it blank and the node falls back to the
BFL_API_KEYenvironment variable, which is the sane way to keep keys out of your workflows. - safety_tolerance - 0 to 6, default 6 (the most permissive). Klein is heavily safety-filtered, so this is a dial, not a jailbreak.
- output_format - jpeg, png, or webp for the download.
Optional but worth knowing: seed (or -1 for random), finetune_id plus finetune_strength (0–2, default 1) for BFL-hosted finetunes, and image_1 through image_4 as reference/input images. The only output is image, which you wire into a SaveImage or PreviewImage.
Installing it
It ships inside the Detail Stitch pack, so ComfyUI Manager (search Detail Stitch) or:
cd ComfyUI/custom_nodes
git clone https://github.com/mancusog/comfyui-detail-stitch.git
Then restart ComfyUI. The good news: unlike most of the pack this node's dependencies are just requests, PIL and numpy - all already present in ComfyUI. There is no requirements.txt and no model to download. The "heavy dependency" here is a paid account at bfl.ai.
Where people get burned
- "BFL API key not provided" - you skipped both the field and the env var. Set
BFL_API_KEYin your environment or the node. - "Request Moderated" errors - Klein's censorship is aggressive; a flagged prompt fails the job instead of returning an image. Rephrase rather than fighting the tolerance slider.
- It times out after five minutes - busy API queues happen; that's a failure, not a freeze.
- It costs money per image - every run burns BFL credits. Great for occasional edits, painful as a batch default.
One more quirk: the pack's README never mentions this node at all - it's in the code but not the docs, so don't be surprised that the example workflow skips it and runs Klein locally via UNETLoader instead. If you have the VRAM, local is cheaper; if you don't, this is the node.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| width | INT | 1024256–4096 | — |
| height | INT | 1024256–4096 | — |
| api_key | STRING | — | |
| safety_tolerance | INT | 60–6 | — |
| output_format | COMBO | 3 options: jpeg, png, webp | |
| seedopt | INT | -1-1–4294967295 | — |
| finetune_idopt | STRING | — | |
| finetune_strengthopt | FLOAT | 1.000–2 | — |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |