CivArchive
    VaceSwap! FaceSwapping with Vace + Wan2.1 - VaceSwapWorkflowV3

    Input a Video and inpaint a new face onto your subject character, then swap that face into the rest of the video! Lip movement is tough with just this workflow. You may want to use LatentSync to do a lipsync pass if accurate lip motion is required.

    V1: Use if you don't care about facial expressions

    V2: Use for portraits/close-up (degrades further away because it uses MediaPipe)

    V3: Use for anything else where you want facial expressions but it isn't a portrait! (Quality is the worst with this one, may have to do a little cleaning up after)

    For a demo & tutorial, you can watch here! Unfortunately it doesn't have the facial expressions versions in the video, but everything else is the same!

    Description

    Added A Depth/OpenPose Blend for Mouth Movements and non-portraits

    FAQ

    Comments (41)

    squiredApr 7, 2025
    CivitAI

    whoa..

    theartofficialtrainer
    Author
    Apr 7, 2025

    Did not expect it to work this well when I started working on the workflow

    bhassApr 7, 2025
    CivitAI

    Mine shows a bunch of nodes missing, and the manager doesn't seem to be able to fetch them.

    WanVideoExperimentalArgs

    WanVideoVACEModelSelect

    DownloadAndLoadSAM2Model

    WanVideoVACEEncode

    Sam2Segmentation

    MediaPipe-FaceMeshPreprocessor

    Any pointers?

    theartofficialtrainer
    Author
    Apr 7, 2025· 2 reactions

    Mediapipe: https://github.com/Fannovel16/comfyui_controlnet_aux

    WanVideo: Broken/Not Updated WanWrapper version. Delete the folder and reinstall

    SAM2 Seg: https://github.com/kijai/ComfyUI-segment-anything-2

    singularity42Apr 7, 2025
    CivitAI
    funscripter627Apr 7, 2025· 1 reaction

    I got the same error. I think you need to downgrade protobuf, at least that's what google and chagpt told me. Couldn't get it to work though.

    theartofficialtrainer
    Author
    Apr 7, 2025· 1 reaction

    Try V3! It doesn’t use mediapipe

    singularity42Apr 8, 2025

    huh, i cant get any of them to run. They actually completely crash out the comfyui process itself. crazy.

    singularity42Apr 8, 2025

    ok, i got it finally working, sort of. It doesnt actually crash everything anymore, but the video itself comes out the wrong resolution/size. Working on fixing it.

    singularity42Apr 8, 2025

    Hey, Im about 3 hours into trying to get this to work. Ive fixed a lot of the issues. However, it seems like this workflow is very incomplete? Even some of the nodes are missing input links. The input video and output videos are two totally different sizes, the masking output is rotated 90 degrees from the input video. Many, many issues. Ill go and watch your video again and try to compare it to the workflows and make more fixes. But right now this workflow is almost impossible to work with. Excited to get it working though.

    theartofficialtrainer
    Author
    Apr 8, 2025

    @singularity42 Yeah, the video shows where to update the sizes. I probably should update it so that there is one size input.

    ikJun 3, 2025

    Same. Anyone got the Mediapipe working?

    CatzApr 7, 2025
    CivitAI

    Woah this looks incredible! Would be cool to have further automation in the face swap process (maybe without PuLID) as it has strict depedencies conflict.

    Thanks for the video - I might recommend to add some notes at certain areas in the workflow to precise what you mention and also notes on the order of bypass.

    Thanks for the share!

    theartofficialtrainer
    Author
    Apr 7, 2025· 1 reaction

    Yeah, there still isn't really a better option than PuLID that I've found. The only other thing is Gemini API, which is decent, but I hate having an API call in the workflow for some reason haha.

    CatzApr 7, 2025

    @theartofficialtrainer how about reactor face swap + face detector or flux inpaint with face detect for custom new face

    theartofficialtrainer
    Author
    Apr 7, 2025· 1 reaction

    @Catz reactor swap kind of defeats the purpose though since the objective is to get a better faceswap than reactor. Might as well just use reactor for the whole thing if we use it for the initial image. Never tried face detect though! That could be cool. Have a link?

    CatzApr 8, 2025

    @theartofficialtrainer It's basically the Face Detailer node with Ultralytics Adetailers. It'll automatically detect the face and let you generate on top. From Impact Pack nodes.
    https://github.com/ltdrdata/ComfyUI-Impact-Pack

    Posted an example in the gallery.

    theartofficialtrainer
    Author
    Apr 8, 2025

    @Catz Oh yeah I know that one! That requires a Lora already generated though, right? There’s no way to use a reference unless maybe using redux or PuLID

    CatzApr 8, 2025

    @theartofficialtrainer Hmm you can generate it without any lora, just a checkpoint. You can use a Lora for enhancement sure, but you can use SDXL or Flux to quickly reconstruct the face. I think the Adetailer option would just be for creating a brand new face.

    For using a reference image face, then yes I think something like PuLID would be great (I tried PuLID a year ago on a virgin comfyui, but never got it working with my main comfy). I forget if PuLID automatically face detect and swap it or if you need to precise the area.

    @theartofficialtrainer @Catz If either of you can implement the option of using a face Lora into the workflow I would greatly appreciate it. I have trained a face lora in flux that I would need to have this for.

    theartofficialtrainer
    Author
    Apr 10, 2025

    @pandasarethebest4910 just put it in the flux image generation part of the workflow! Just need to add “loadloramodelonly” node after load diffusion model

    jm112368767Apr 7, 2025
    CivitAI

    This workflow, along with VACE model, works GREAT! thanks!

    basscolorprivate601Apr 8, 2025· 6 reactions
    CivitAI

    When I move around within the workflow, it freezes. Is this only happening in my environment?

    theartofficialtrainer
    Author
    Apr 8, 2025

    I think it has something to do with SAM2. Either try updating it or uninstalling if you want to see if that is what’s causing the issue.

    killtheeggApr 9, 2025

    @theartofficialtrainer I uninstalled it and still freezing

    hellolacoApr 9, 2025

    same for me

    tcla75542Apr 10, 2025

    @theartofficialtrainer  Also happening here. This doesn't happen with any other workflow I am using so there is something in your workflow that is causing freezing for a lot of users. Can you update the workflow omitting whatever is causing the freezing as it is unusable as it is right now.

    theartofficialtrainer
    Author
    Apr 10, 2025

    @tcla75542 I don’t know what is causing the freezing, it doesnt freeze for me

    Lime81Apr 11, 2025

    same for me... also i'm trying another workflow Wan2.1-Fun Control Workflows Native+Wrapper + First Frame Control.. the same problem. it freezes when i'm trying to move around or scale it. Btw Remove ANYTHING with VACE+Wan2.1 workflow had no problem, it worked like a charm.

    killtheeggApr 20, 2025

    A fresh install was the solution, I don't know why. But now it's works

    AlchedApr 28, 2025

    @killtheegg What did you fresh install?

    banditlevel200Apr 8, 2025
    CivitAI

    For an updated version maybe add a bypassed lora loader since you said that works better, and note next to the loaders where it says step by step what to do. Other wise quite clean workflow

    Ai_for_youApr 8, 2025
    CivitAI

    It makes really good results for texture compared to faceswap, but, could you say how much generation time /second of video, with a reference setup ?

    theartofficialtrainer
    Author
    Apr 8, 2025

    I am on a 5090, but this took about 1.5mins per clip.

    Ai_for_youApr 11, 2025

    Thanks for the reply, so its 20x video length + limited to some seconds. Really good but not sutable (for now) as a reactor new challenger

    seductivelyai695Apr 12, 2025
    CivitAI

    Hmm.. any idea what could cause this.. when I try to generate the video.

    ImagePadKJ

    The expanded size of the tensor (160) must match the existing size (832) at non-singleton dimension 0. Target sizes: [160, 480, 3]. Tensor sizes: [832, 480, 3

    theartofficialtrainer
    Author
    Apr 13, 2025

    One of your videos is 160x480 or it’s being resized to that. Everything should be 480x832 when passed through the wan sampler

    seductivelyai695Apr 13, 2025

    I was able to fix this error. by changing the target width and target height to match the image. this allowed me get further, but then it died on the depth section.

    odel_path is D:\apps\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux\ckpts\LiheYoung\Depth-Anything\checkpoints\depth_anything_vitl14.pth
    using MLP layer as FFN
    input_masks shape torch.Size([210, 832, 480])
    refs shape torch.Size([1, 3, 1, 832, 480])
    !!! Exception during processing !!! Invalid WanVideo model selected

    Ouch!

    seductivelyai695Apr 13, 2025

    also, all the frames of the video are being dumped in my output folder.. why is it doing that?

    LilaLemonTreeApr 23, 2025
    CivitAI

    Its not doing anything for me in v2

    GrobotronusAug 17, 2025
    CivitAI
    I get this error: Tensor qk_int8_sv_f16_accum_f32_attn(at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, long long, long long, long long, double, long long) failed to dispatch data type BFloat16 Can you help me?

    Workflows
    Wan Video

    Details

    Downloads
    2,198
    Platform
    CivitAI
    Platform Status
    Available
    Created
    4/7/2025
    Updated
    8/12/2026
    Deleted
    -

    Files

    vaceswapFaceswappingWith_vaceswapworkflowv3.zip