Expand Image is a guided outpainting workflow that grows a single photo to any target aspect ratio without cropping or distorting the original pixels. It wraps your image in a flat green matte to reach the new canvas size, then uses Qwen Image Edit 2511 to replace only the green area with believable scene continuation. Core utility nodes—GetImageSize, ImageResizeKJv2, CustomCombo, and ComfyNumberConvert—calculate the new dimensions and margins so the source stays centered and untouched while the surrounding frame becomes the editable region.

To keep the new content on-style and on-topic, the workflow can automatically write a scene-continuation caption for the missing region using TextGenerateLTX2Prompt and a local VLM backend (configured by you), then JsonExtractString parses the result. A ComfySwitchNode lets you flip between that auto caption and a manual description you type in PrimitiveStringMultiline. The final instruction is assembled with StringConcatenate and, together with CLIPLoader (for text conditioning when required), guides Qwen Image Edit 2511 to synthesize lighting, materials, and perspective that match the visible photo. PreviewAny and ImageCompare help you evaluate changes, and SaveImageAdvanced stores the outpainted result and metadata for reproducibility.

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.

f8cf4feac2e9.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 this workflow (TypeScript)
import { Comfy } from "@comfyorg/sdk";

const client = new Comfy({ apiKey: "comfyui-..." });
const wf = await client.workflows.fromFile("workflow_api.json");
const job = await client.run(wf);
await job.getOutputs("<output-node-id>")[0].toFile("output.png");

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
Character
Cinematic
Image to Video
Lip Sync
Multiple Angles
Portrait
Style Reference
Style Transfer
Text to Video
Video Generation
Video
Showing 30 of 30 templates