Flux Outpaint (BFL)
Outpainting where you decide the canvas, not the model
- config
- IMAGE
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 andreference_offset_x/yget 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_cropis off (the default), BFL returns a 422 and you get a black image. Turnauto_cropon if you're doing manual offsets. - mode -
high(default, best fidelity and prompt adherence) orfast(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_cropoff. Re-enable centering or turn on auto_crop. - Fast mode silently ignored. It only takes effect when set to
fast; the node sendsmodeonly 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.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| input_image | STRING | Reference image to expand (base64-encoded string). | |
| width | INT | 102464–4096 | Target canvas width in pixels (>=64). |
| height | INT | 102464–4096 | Target canvas height in pixels (>=64). |
| output_format | COMBO | png | png (default) or jpeg. |
| promptopt | STRING | Experimental: 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_referenceopt | BOOLEAN | true | When 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_xopt | INT | 0-8192–8192 | Left offset (px) of the reference image's top-left corner on the canvas. Negative values allowed. None = center horizontally. |
| reference_offset_yopt | INT | 0-8192–8192 | Top offset (px) of the reference image's top-left corner on the canvas. Negative values allowed. None = center vertically. |
| auto_cropopt | BOOLEAN | false | If true, crop the reference image to the canvas bounds when it extends beyond the edges. Defaults to false (out-of-bounds placements return 422). |
| modeopt | COMBO | high | Quality/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. |
| configopt | BFL_CONFIG | Optional Flux Config (BFL) override for x-key, base URL, and region. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |