Nodes/ComfyUI_Wan/Wan VACE - Local Video Editing
ComfyUI Node

Wan VACE - Local Video Editing

Changing one thing in a video without touching the rest (via cloud Wan VACE)

By ru4ls·Created 12 months ago·Updated 11 months ago· 3
Wan VACE - Local Video Editing
    • video_file_path
    • video_url
    modelwan2.1-vace-plus
    promptEdit the video with the following description
    video_url
    regioninternational
    ref_images_url
    mask_image_url
    mask_frame_id1
    mask_video_url
    control_condition
    mask_typetracking
    expand_ratio0.05
    expand_modehull
    size1280*720
    seed0
    prompt_extendfalse
    watermarkfalse
    output_dir./videos

    You've got a clip of a person walking past a wall, and you want the poster on that wall swapped for something else - with the person, the motion, and everything else untouched. That's local video editing, and WanVACEVideoEdit ("Wan VACE - Local Video Editing") is the cloud take on it: the Wan 2.1 VACE model, running on Alibaba's DashScope API, editing only the region you tell it to.

    This is the fiddliest node in the ru4ls/ComfyUI_Wan pack, because unlike plain repainting it needs a mask to know where to edit. But it's also the one where the result feels like magic when it works. And it's worth noting what you're not doing: no 14B model grinding on your GPU for 15-40 minutes. It's all on their servers, billed per job.

    How it works

    VACE is Alibaba's Video-Aware Context Extension framework - the same tech that powers the open-source Wan 2.1 VACE you may have seen running locally, just hosted. You feed it a video plus a description of the edit, and the model re-generates only the masked area while preserving the rest of the scene and its motion. The cloud side handles the heavy lifting of tracking what the mask points at across frames.

    The important inputs are the mask controls:

    • mask_image_url - a URL to a mask image that marks the region to edit. White = edited, black = left alone. This is the core of a local edit.
    • mask_type - tracking (default) lets the model follow the masked object as it moves through the clip; fixed holds the mask in place.
    • mask_frame_id - which frame the mask image refers to (default 1). If your mask is drawn on frame 1 and the object moves, tracking needs to know that.
    • expand_ratio and expand_mode - how much padding to give the masked area (0.05 default) and the shape it grows in (hull polygon, bbox, or original). Crank expand_ratio if your edit's edges look cropped.

    Everything else is familiar from the rest of the pack. prompt describes the edit ("replace the poster with a neon sign"), video_url is the source clip, and the optional ref_images_url takes a single reference image if you want the edit to match something specific. control_condition (posebodyface, posebody, depth, scribble) extracts motion/composition features from the input to keep the edit aligned with the original movement. size gives you output resolutions from 1280*720 down to square.

    The big gotcha: URLs, not files

    The input video_url and mask_image_url are URLs that Alibaba's servers fetch - they can't read your local files. You'll need the source video hosted somewhere publicly reachable (or served from a local endpoint). This trips up everyone on their first VACE run. Same story for any reference image.

    Install and setup

    Search ComfyUI_Wan in ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ru4ls/ComfyUI_Wan.git
    pip install -r ComfyUI_Wan/requirements.txt
    

    Then restart and configure the key - copy config/.env.template to config/.env in the pack folder and set DASHSCOPE_API_KEY (and DASHSCOPE_API_KEY_CHINA if you'll use the mainland China region). The pack's requirements are light: requests, Pillow, numpy, python-dotenv. Everything heavy is server-side, and it's paid per job - keep that in mind before you queue a batch of edits.

    Outputs

    You get two strings out: video_file_path (the mp4 downloaded to your output_dir, default ./videos) and video_url (the remote copy). To actually see the result in ComfyUI, feed video_file_path into a "Load Video (Path)" node from ComfyUI-VideoHelperSuite - the pack's README calls this out for every video node, and it's the step people forget.

    A warning on expectations: mask tracking is where cloud VACE wobbles. If the object rotates a lot or leaves the frame, tracking can drift. When that happens, try fixed, or pad the mask with a bigger expand_ratio. The fix is almost always on the mask side, not the prompt.

    CategoryRu4ls/Wan/VACE

    Inputs (17)

    NameTypeDefaultDescription
    modelCOMBOwan2.1-vace-plus1 options: wan2.1-vace-plus
    promptSTRINGEdit the video with the following description
    video_urlSTRINGURL of the input video
    regionCOMBOinternational2 options: international, mainland_china
    ref_images_urloptSTRINGNewline-separated URLs for reference images (only 1 image supported)
    mask_image_urloptSTRINGURL of the mask image
    mask_frame_idoptINT11–1000
    mask_video_urloptSTRINGURL of the mask video
    control_conditionoptCOMBO5 options: , posebodyface, posebody, depth, scribble
    mask_typeoptCOMBOtracking2 options: tracking, fixed
    expand_ratiooptFLOAT0.050–1
    expand_modeoptCOMBOhull3 options: hull, bbox, original
    sizeoptCOMBO1280*7205 options: 1280*720, 720*1280, 960*960, 832*1088, 1088*832
    seedoptINT00–2147483647
    prompt_extendoptBOOLEANfalse
    watermarkoptBOOLEANfalse
    output_diroptSTRING./videosDirectory where the generated video will be saved. Browse to select a custom directory.

    Outputs (2)

    NameTypeDescription
    video_file_pathSTRING
    video_urlSTRING