Wan2.1 VACE Inpainting - After
Wan2.1 VACE Inpainting - Before

The Wan2.1 VACE Inpainting workflow is designed to seamlessly edit specific regions in video content while preserving the integrity of the surrounding areas. This is particularly useful for tasks such as object removal or replacement in video sequences. Utilizing the Wan2.1 model, this workflow leverages a combination of nodes including KSampler for sampling, CLIPTextEncode for text encoding, and VAEDecode for decoding video frames. The workflow is structured into several steps, starting from loading models and video files, to creating masks and compositing the final video output.

Technically, the workflow employs the WanVaceToVideo node to convert inpainted frames back into video format, while the TrimVideoLatent and CreateVideo nodes manage the video length and format. The ImageCompositeMasked node is crucial for blending the inpainted regions with the original video, ensuring a natural look. By using core nodes, the workflow avoids the need for additional custom installations, making it accessible and easy to implement. This workflow is particularly valuable for content creators and video editors who need to make precise edits without affecting the overall quality of the video.

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.

video_wan_vace_inpainting.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 "Wan2.1 VACE Inpainting" (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("video_wan_vace_inpainting_api.json");

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

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

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