ComfyUI Node

BFL Flux 2 Flex

The Flux 2 API node that actually gives you dials

By charlyad142·Created about a year ago·Updated 9 months ago· 0
BFL Flux 2 Flex
  • input_image
  • input_image_2
  • input_image_3
  • input_image_4
  • input_image_5
  • input_image_6
  • input_image_7
  • input_image_8
  • IMAGE
  • STRING
prompt
safety_tolerance2
output_formatjpeg
x_key
input_image_blob_path
seed-1
width0
height0
guidance5.00
steps50
prompt_upsamplingtrue

Flux 2 Flex is the one node in this pack that still lets you steer. Its sibling, Flux 2 Pro, takes a prompt and up to eight reference images and quietly does its thing. Flex hands you guidance, steps, prompt upsampling, output dimensions and even a blob path for your inputs - which makes it the closer of the two if you actually want to iterate on a generation instead of just firing it off.

Here's the thing about Flux 2: locally, it's a 32B rectified-flow transformer with a 24B vision-language text encoder. That's roughly 56GB of weights end to end, and the community's verdict on self-hosting it was blunt - "an attempt to get everyone to just use the API inference services instead of self-hosting," as one r/StableDiffusion thread put it. This node is that API inference, wrapped in a ComfyUI box. No model download, no VRAM bill, you pay BFL per image.

What it is

A bridge node from charlyad142/ComfyUI_bfl_api_pro_nodes that calls BFL's flux-2-flex endpoint. It does text-to-image and, more interestingly, multi-reference composition: you can feed it up to eight input_image sockets and it'll use them as visual context - the API-side version of Flux 2's whole "compose from multiple references" party trick, without any of the local hardware tax.

How it works

The node base64-encodes any images you wire in, POSTs them plus your settings to https://api.bfl.ai/v1/flux-2-flex with your API key in the x-key header, gets a task ID back, then polls get_result until the image is ready. The finished picture is downloaded from Azure Blob Storage and handed to you as a normal ComfyUI IMAGE tensor. There's a second output, a STRING status line: on success, or a ✗ Error: ... message with details when it fails. If something does fail, you'll also get a solid red 512px placeholder image instead of a crash - read that STRING output to find out why.

The inputs that matter

Beyond prompt (required, multiline), only a few are worth touching:

  • guidance (1.5–10, default 5) and steps (1–50, default 50) - the controls Pro doesn't have. Lower steps for speed, higher guidance for adherence.
  • prompt_upsampling (default true) - BFL re-writes and enriches your prompt internally before generating. Leave it on unless your prompt is already doing exactly what you want.
  • input_image through input_image_8 - your reference images, up to eight. Just input_image alone turns this into a single-image editor; loading several is where Flux 2's composition muscle shows.
  • width / height (min 64) - both default to 0, which means "let the API decide." Only set them if you need a specific size.
  • seed (default -1) - -1 is random; set a fixed number to reproduce a result.

Two things you'll see but rarely touch: safety_tolerance (0–5, default 2) is BFL's moderation dial, and input_image_blob_path lets you pass a URL/path to an already-uploaded blob instead of a base64 image - handy in exotic pipelines, ignorable otherwise.

Installing it

It's API-only, so there's nothing heavy to download. In ComfyUI Manager, search for "ComfyUI BFL API Pro Nodes" and install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/charlyad142/ComfyUI_bfl_api_pro_nodes

Restart ComfyUI. The pack has no requirements.txt - it leans on requests and Pillow, which ComfyUI already ships.

Then give it a key. Create config.ini in the node's root folder (it's the pack's recommended option and takes priority):

[API]
X_KEY = your_api_key_here

Or paste the key into the node's x_key field. Grab a key at auth.bfl.ai. No key, no work - you'll get the API-key error through that STRING output.

Troubleshooting

The usual suspects: a 401 means the key is bad or out of credits; 422 is a validation error in your parameters; 429 means you're hammering the rate limit. If the API moderation kicks in you'll see "Request Moderated" or "Content Moderated" in the status - that's BFL's safety filter, not a bug, and bumping safety_tolerance only does so much. It's a small, low-profile pack, so when in doubt open an issue on the GitHub repo.

CategoryBFL/Flux2

Inputs (19)

NameTypeDefaultDescription
promptSTRING
safety_toleranceINT20–5
output_formatCOMBOjpeg2 options: jpeg, png
x_keySTRING
input_imageoptIMAGE
input_image_2optIMAGE
input_image_3optIMAGE
input_image_4optIMAGE
input_image_5optIMAGE
input_image_6optIMAGE
input_image_7optIMAGE
input_image_8optIMAGE
input_image_blob_pathoptSTRING
seedoptINT-1
widthoptINT0
heightoptINT0
guidanceoptFLOAT5.001.5–10
stepsoptINT501–50
prompt_upsamplingoptBOOLEANtrue

Outputs (2)

NameTypeDescription
IMAGEIMAGE
STRINGSTRING