The Wan Animate 2.2 Character Replacement Workflow is designed to replace characters and scenes in video content using advanced AI models. This workflow leverages the power of the Wan 2.2 Animate model, which is specifically optimized for human subjects, ensuring that the character replacement is both stable and convincing. The process begins by utilizing the Nano Banana 2 model to generate a reference image from the first frame of the video. This image serves as the basis for replacing the character throughout the entire video sequence. The workflow employs several custom nodes, including ComfyUI-WanAnimatePreprocess and ComfyUI-segment-anything-2, to segment and process the video frames effectively.
Technically, the workflow uses a combination of nodes such as VHS_LoadVideo to load the video, and GeminiNanoBanana2 to apply the character replacement based on the reference image. The SaveVideo node is then used to output the final animated video. This workflow is particularly useful for creators looking to produce high-quality character animations in video content, offering a seamless integration of AI-driven techniques to enhance video production capabilities. By focusing on human subjects, it ensures that the facial and body features are rendered with high fidelity, making it ideal for projects that require realistic character animations.
API
從程式碼使用此工作流
每個 Comfy 工作流都是一個 JSON 圖。下方的 payload 就是此工作流,與 ComfyUI 執行時完全相同 — 你可以從此 URL 取得、放入版本控制,或在 ComfyUI 載入並逐節點執行。
使用 Comfy SDK 以 TypeScript 或 Python 執行。相同程式碼可用於 Comfy Cloud 或你自架的 ComfyUI — 只需更改 base URL。
// Install (beta)
npm i @comfyorg/sdk
// Run "Wan萬相動畫2.2角色替換工作流程" (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("templates_purz_wan22_animate_auto_full_scene_api.json");
const job = await client.run(wf);
await job.getOutputs("349")[0].toFile("output.png"); // SaveImageSDK 需使用 API 格式的工作流:請在 ComfyUI 開啟此工作流,並使用 檔案 → 匯出工作流(API)。
常見問題















