Apr-10-25 hotfix:
Made some changes to the workflow to improve quality, see the "About this version" section for details.
This workflow implements SAM3 for character masking.
It uses looping to process long videos, and while it can theoretically generate infinitely long videos, in practice it is limited by VRAM and processing time.
It supports both Wan Animate modes: character animation and character swap.
It has been tested on 1-minute, 480p videos using an RTX 4090 with 64GB of RAM, though it supports 360p, 720p and 1080p resolutions too. My tests suggest you can generate up to 20 seconds at 1080p with an RTX 4090 using a video batch size of 80 frames (if you have the patience and the time for it).
Features:
Character animation:
Full reference image animation using a video reference.
Character swap:
Insert a character in-place in a video using high quality segmentation with SAM3.
Face swap:
Possible using "face" as "CHARACTER ISOLATION DESCRIPTION", but don't expect miracles. You can achieve better results by face swamping the face separately using some edit model like Flux Klein or Qwen edit and then use that new edited image as your Character Reference Image using the character animation feature. 
Detailed instructions are contained within the workflow itself:
- Yellow nodes are input and configuration nodes you can change to suit your needs.
- Red nodes are instructions and helpful notes
Description
First version release.