
Wan2.1 VACE Reference to Video turns a single image into a short video that preserves your reference’s style and subject while introducing motion guided by text prompts. The core of the workflow is the WanVaceToVideo node, which fuses a loaded reference image (LoadImage) with prompt text encoded by CLIPTextEncode. The diffusion backbone is provided by the Wan 2.1 VACE models—use UNETLoader and VAELoader in the “Load models here” group to select either Wan2.1-VACE-1.3B or Wan2.1-VACE-14B. A ModelSamplingSD3 node configures the sampler, and KSampler handles denoising with your chosen steps and cfg scale. If you need stylistic adapters, LoraLoader lets you apply a matching LoRA to the same diffusion model family.
After sampling, VAEDecode reconstructs frames from latents. TrimVideoLatent helps you set exact duration, and the “First Frame control” group (ImageToMask, SolidMask, MaskToImage, RepeatImageBatch) can lock or protect parts of the initial frame for stronger identity or composition retention. PreviewImage nodes allow quick QC during iteration. Finally, CreateVideo aggregates frames and you can export via SaveVideo (MP4) or SaveAnimatedWEBP for lightweight previews. Author guidance: default steps=20 and cfg=6.0 work well; with CausVid LoRA use fewer steps (2–4) and a low cfg (~1.0). For resolution, VACE-1.3B is suited to 480p, while VACE-14B delivers higher quality and supports 480p and 720p at the cost of longer render time.
API
從程式碼使用此工作流
每個 Comfy 工作流都是一個 JSON 圖。下方的 payload 就是此工作流,與 ComfyUI 執行時完全相同 — 你可以從此 URL 取得、放入版本控制,或在 ComfyUI 載入並逐節點執行。
使用 Comfy SDK 以 TypeScript 或 Python 執行。相同程式碼可用於 Comfy Cloud 或你自架的 ComfyUI — 只需更改 base URL。
// Install (beta)
npm i @comfyorg/sdk
// Run "Wan2.1 VACE 參考生影片" (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_14B_ref2v_api.json");
const asset = client.assets.fromFile("input.png");
wf.setInput("73", "image", asset); // LoadImage
wf.setInput("105", "text", "your prompt here"); // CLIPTextEncode
const job = await client.run(wf);
await job.getOutputs("70")[0].toFile("output.png"); // SaveAnimatedWEBPSDK 需使用 API 格式的工作流:請在 ComfyUI 開啟此工作流,並使用 檔案 → 匯出工作流(API)。
常見問題













