
This workflow turns a reference video into a new video featuring your chosen character while preserving the motion, framing, and timing of the original. It uses the Wan2.7 model via the Wan2ReferenceVideoApi node to track the reference video’s movement and composition, then conditions generation on a single character image you load with the LoadImage node. The output is a sequence of frames that maintain the target character’s facial features and overall look across time, which the SaveVideo node encodes into a final video file.
Technically, Wan2ReferenceVideoApi ingests the reference video and extracts per-frame motion cues and scene layout. It then conditions Wan2.7 with the identity information from your character image so the model synthesizes each frame with consistent facial features and styling, while following the original camera and body movement. The node outputs generated frames for SaveVideo to assemble at your chosen frame rate and filename. This approach is useful when you want character consistency without manual keying or heavy rotoscoping, and it works well for short clips, social content, and previz.
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.
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.7: Reference to Video" (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("api_wan2_7_r2v_api.json");
const asset = client.assets.fromFile("input.png");
wf.setInput("4", "image", asset); // LoadImage
const job = await client.run(wf);
await job.getOutputs("7")[0].toFile("output.png"); // SaveVideoThe 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













