Flux.1 Outpaint - After
Flux.1 Outpaint - Before

The Flux.1 Outpaint workflow in ComfyUI is designed to extend images beyond their original boundaries, a process known as outpainting. This technique is particularly useful for enhancing images by adding context or creating a larger scene from an existing image. The workflow utilizes several key nodes and models, including the Flux.1 model for outpainting, which is guided by the FluxGuidance node. The process begins with loading the necessary models and the image to be outpainted, followed by padding the image using the ImagePadForOutpaint node to prepare it for expansion. The KSampler node is then used to iteratively generate new image sections, while the VAEDecode and UNETLoader nodes work together to ensure the generated content blends seamlessly with the original image.

This workflow is particularly useful because it leverages advanced AI models to maintain the aesthetic and thematic consistency of the original image while expanding its boundaries. The use of the CLIPTextEncode node allows for the incorporation of textual prompts, guiding the outpainting process to align with specific themes or styles. This makes the workflow versatile for various applications, from artistic image creation to practical uses in design and media production.

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.

flux_fill_outpaint_example.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 Outpaint" (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("flux_fill_outpaint_example_api.json");

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

wf.setInput("23", "text", "beautiful scenery"); // CLIPTextEncode

const job = await client.run(wf);
await job.getOutputs("9")[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