Flux.1: Image Outpainting - After
Flux.1: Image Outpainting - Before

The Flux.1: Image Outpainting workflow is designed to seamlessly expand the canvas of an existing image by generating new content that blends naturally with the original. This workflow leverages the Flux.1 model, which is specifically trained for outpainting tasks, ensuring that the extended areas of the image maintain consistency in style and content. The process begins with the LoadImage node, where users can upload their desired image. The FluxProExpandNode then takes over, using advanced algorithms to predict and generate the surrounding areas of the image, effectively 'outpainting' the canvas. Finally, the SaveImage node allows users to save the newly expanded image to their device. This workflow is particularly useful for artists and designers looking to enhance or modify their images without losing the original aesthetic.

API

Use this workflow from code

Every Comfy workflow is a JSON graph. The payload below is this workflow, exactly as ComfyUI runs it — fetch it from the URL, keep it in version control, or load it in ComfyUI and run it node by node.

api_bfl_flux1_expand_image.json
Fetching workflow JSON…

Run it from TypeScript or Python with the Comfy SDK. The same code targets Comfy Cloud or a ComfyUI you host yourself — only the base URL changes.

// Install (beta)
npm i @comfyorg/sdk

// Run "Flux.1: Image Outpainting" (TypeScript)
import { Comfy } from "@comfyorg/sdk";

const client = new Comfy({ apiKey: "comfyui-..." });

// This workflow, exported in API format (see note below)
const wf = await client.workflows.fromFile("api_bfl_flux1_expand_image_api.json");

const asset = client.assets.fromFile("input.png");
wf.setInput("17", "image", asset); // LoadImage

const job = await client.run(wf);
await job.getOutputs("5")[0].toFile("output.png"); // SaveImage

The SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API).

Comfy Cloud API access requires a plan with an API key.

FAQ

Frequently Asked Questions

View all workflows
Showing 30 of 30 templates