Flux Pro Fill (BFL)
BFL's Fill, wired into your ComfyUI graph — inpainting and outpainting without touching VRAM
- config
- IMAGE
Flux Fill is BFL's official inpainting/outpainting model, and this node is the piece that plugs it into your ComfyUI graph. You give it an image, a mask over the part you want regenerated, and a prompt; it returns a finished edit with the cloud doing all the heavy lifting. If you've ever fought with local inpainting - the VAE encode/decode degradation, the inpaint model juggling, the VRAM math - this is the "just pay and it works" alternative.
It sits in gelasdev's ComfyUI-FLUX-BFL-API pack alongside the Pro 1.1 wrappers, so all the shared caveats apply: this is a remote API, you pay per image, and there are no local weights involved. What makes Fill different from the text-to-image nodes is plumbing: images and masks travel as base64 strings, not IMAGE tensors.
How it works
Same async pattern as every node in the pack: POST to api.bfl.ai/v1/flux-pro-1.0-fill, poll get_result every five seconds, decode when READY, output an IMAGE. But look at the required inputs and you'll notice image and mask are STRING, not IMAGE. That's base64 encoded data - the API wants your pixels encoded, so you need the pack's Image to Base64 (BFL) node between your LoadImage/MaskToImage and this node.
It also has knobs the text-to-image nodes don't: steps (15–50, default 50) and guidance (1.5–100, default 60). Fill is a full diffusion run, not a distilled quickie, so those are real controls over edit quality.
The inputs that matter
- image and mask - base64 strings. Load your image, build a mask, run both through Image to Base64 (BFL). For the mask, set that node's format to png - jpeg's lossy compression can eat fine mask edges, and the README is explicit that png is the recommended choice for masks.
- prompt - describes what should fill the masked area. With an empty mask the model behaves more like outpainting/editing; with a tight mask, precise inpainting.
- steps - more is slower and more expensive but generally better for fills; 50 is a sane ceiling, and the node's default is already there.
- guidance - default 60, and it's the one most people end up nudging. Too low and the fill ignores your prompt; too high and it starts to look cooked.
- safety_tolerance (0–6, default 2) and output_format - the usual pack-wide settings.
seed (-1 = random), webhook_url/webhook_secret, and config round out the optionals. Output is a single IMAGE.
Installing
Identical to the rest of the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/gelasdev/ComfyUI-FLUX-BFL-API.git
pip install -r requirements.txt # just torch
Restart, put your key from api.bfl.ai into config.ini - or wire a Flux Config (BFL) node into config so the key lives in the workflow instead of a file that updates will wipe.
Common issues
The mask-not-encoding warning is worth knowing: if the mask string comes through empty, the node prints "Proceeding without mask" and runs anyway - which turns your careful inpaint into a whole-image edit. Double-check that Image to Base64 node is actually wired and producing output.
And the pack-wide failure mode: a blank 512×512 black image means something went wrong upstream (bad key, CONTENT_MODERATED, empty mask, exhausted poll). Read the [BFL] lines in the console rather than re-rolling the seed.
One community workflow note that applies here too: if you composite the Fill result back onto your original image, you're combining the AI edit with untouched original pixels, which beats letting the model redraw everything - a lesson Flux users learned the hard way back when Flux Tools launched.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| image | STRING | — | |
| mask | STRING | — | |
| prompt | STRING | — | |
| steps | INT | 5015–50 | — |
| prompt_upsampling | BOOLEAN | false | — |
| guidance | FLOAT | 60.001.5–100 | — |
| safety_tolerance | INT | 20–6 | — |
| output_format | COMBO | jpeg | 2 options: jpeg, png |
| seedopt | INT | -1 | — |
| webhook_urlopt | STRING | — | |
| webhook_secretopt | STRING | — | |
| configopt | BFL_CONFIG | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |