Nodes/ComfyUI-FLUX-BFL-API/Flux Outpaint (BFL)
ComfyUI Node

Flux Outpaint (BFL)

Outpainting where you decide the canvas, not the model

By gelasdev·Created 2 years ago·Updated 25 days ago· 49
Flux Outpaint (BFL)
  • config
  • IMAGE
input_image
width1024
height1024
output_formatpng
prompt
center_referencetrue
reference_offset_x0
reference_offset_y0
auto_cropfalse
modehigh

Flux Outpaint (BFL) takes an image and extends it onto a bigger canvas - you pick the final dimensions, and BFL's flux-tools/outpainting-v1 fills in whatever's missing. Portrait into landscape, square into banner, or just giving a cramped composition room to breathe. It's the "make the frame bigger" node in the ComfyUI-FLUX-BFL-API pack, and unlike Flux Pro Expand (the older directional-padding node in the same pack), here the whole layout is your call: exact pixel dimensions, where the reference sits on the canvas, and even an optional text prompt for what should appear in the new space.

How it works

Feed in a base64 image (via the pack's Image to Base64 (BFL) node), set a target canvas width and height, and the API figures out the rest - how to extend edges, blend the seams, and fill the new region in a way that matches the source. Internally it's the same post → poll dance as every node in this pack: POST to flux-tools/outpainting-v1, get a task ID, poll get_result?id=... every 5s, and return an IMAGE tensor. Failures (including a 422 from a mis-placed reference) collapse into a black 512×512 image so the workflow doesn't crash.

The inputs that matter

  • input_image - base64 string of the reference to expand.
  • width / height - the target canvas, 64–4096 in steps of 32. This is the size of the output, not your source.
  • center_reference - default True, and you should leave it that way until you know better. When on, the server centers your image on the canvas and omits the offsets entirely. Flip it off and reference_offset_x/y get sent explicitly, so you can pin the reference to the top-left or bottom-right instead of dead center.
  • reference_offset_x / reference_offset_y - placement of the reference's top-left corner, ±8192 px. The trap lives here: if the reference ends up outside the canvas and auto_crop is off (the default), BFL returns a 422 and you get a black image. Turn auto_crop on if you're doing manual offsets.
  • mode - high (default, best fidelity and prompt adherence) or fast (significantly quicker, meant for naturally extending scenes like landscapes and product shots - and it has constraints: canvas+padding under 4MP, aspect ratio ≤8:1).
  • prompt - optional and honestly experimental. The tooltip says it flat out: the model may not strictly follow it, and the input image's own content is the primary signal. Leave it blank for default behavior.

Output is one IMAGE tensor - straight into SaveImage.

Installing it

Same install as every node in this pack - there's only one repo:

cd ComfyUI/custom_nodes
git clone https://github.com/gelasdev/ComfyUI-FLUX-BFL-API.git

Restart ComfyUI, then set your key. Either edit config.ini ([API] X_KEY = YOUR_API_KEY, from api.bfl.ai) or skip the file and drop a Flux Config (BFL) node onto the config socket. No models to download, no heavy deps - the pack's only requirement is torch, which you already have.

Where people get burned

  • Black output on manual placement. Nine times out of ten that's the reference poking past the canvas edge with auto_crop off. Re-enable centering or turn on auto_crop.
  • Fast mode silently ignored. It only takes effect when set to fast; the node sends mode only in that case, so "high" is just "no mode parameter" - don't expect a different response shape.
  • Unexpected resolution. The output is whatever canvas you set, not a fixed generation size. Pick dimensions in the same ballpark as your source's aspect ratio unless you actually want the distortion stretch.

Outpaint is one of the few genuinely cloud-worthy jobs - local models still struggle to extend a photo with convincing new content, and this doesn't touch your VRAM. Just remember each run is a paid API call, so nail your canvas size before you hit queue.

CategoryBFL

Inputs (11)

NameTypeDefaultDescription
input_imageSTRINGReference image to expand (base64-encoded string).
widthINT102464–4096Target canvas width in pixels (>=64).
heightINT102464–4096Target canvas height in pixels (>=64).
output_formatCOMBOpngpng (default) or jpeg.
promptoptSTRINGExperimental: optional text guidance for the outpainted region. The model may not strictly follow this prompt; the visual content of the input image is the primary signal. Leave unset for default behavior.
center_referenceoptBOOLEANtrueWhen True (default), the server centers the reference image on the canvas (reference_offset_x/y are omitted from the request). When False, the reference_offset_x/y values below are sent explicitly.
reference_offset_xoptINT0-8192–8192Left offset (px) of the reference image's top-left corner on the canvas. Negative values allowed. None = center horizontally.
reference_offset_yoptINT0-8192–8192Top offset (px) of the reference image's top-left corner on the canvas. Negative values allowed. None = center vertically.
auto_cropoptBOOLEANfalseIf true, crop the reference image to the canvas bounds when it extends beyond the edges. Defaults to false (out-of-bounds placements return 422).
modeoptCOMBOhighQuality/speed tradeoff. 'high' (default) gives highest fidelity and best prompt adherence. 'fast' is significantly faster for naturally extending scenes (landscapes, backgrounds, textures, products) and requires base64 images, placed reference >=64px per side, aspect ratio <=8:1, canvas+padding <=4MP.
configoptBFL_CONFIGOptional Flux Config (BFL) override for x-key, base URL, and region.

Outputs (1)

NameTypeDescription
IMAGEIMAGE