This ComfyUI workflow demonstrates reference-guided video editing with Wan2.7. You load a source clip with LoadVideo, provide one or more reference images with LoadImage, and let the Wan2VideoEditApi node apply character or scene replacements consistently across frames. The node calls the Wan2.7 model to infer identity, attire, and style cues from your references, then synthesizes edited frames that preserve the original camera motion and timing. Finally, SaveVideo assembles the frames into a finished MP4/WEBM with your chosen frame rate and quality.
Technically, the Wan2VideoEditApi node takes three essential inputs: the decoded video frames, the reference image tensor(s), and your textual directions (prompt and optional constraints). It uses the Wan2.7 backbone to align reference identity/style with the target footage while maintaining temporal coherence, so edits remain stable over time rather than flickering frame to frame. This makes the workflow especially useful for swapping a character across an entire shot or re-dressing a scene without rotoscoping. The minimalist node set—LoadVideo → LoadImage → Wan2VideoEditApi → SaveVideo—keeps the pipeline simple while still offering strong control through prompts, reference choice, and edit strength settings exposed by the API node.
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: Video Edit" (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_video_edit_api.json");
const asset = client.assets.fromFile("input.png");
wf.setInput("3", "image", asset); // LoadImage
const job = await client.run(wf);
await job.getOutputs("5")[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















