ComfyUI: Creating a single-frame mask with SAM 2

Demo summary
The demo shows how to use the Point Editor and SAM 2 nodes to generate a mask for only the first frame of the video, as required by Mocha.
Step-by-step
- Use the Point Editor nodes to define the area of the character to be replaced
- Connect the Point Editor output to the SAM 2 model node
- Add a Get Image from Batch node
- Set the Start Index to 0
- Set the Number of Frames to 1
- Feed the single frame into the SAM 2 process
Watch out for
- Mocha requires only a single mask from the first frame of the video
Tips
- If you are unfamiliar with Point Editor nodes, refer to the creator's previous video for a detailed explanation
All demos from “Mocha vs Wan2.2 Animate: Best Workflow for PERFECT Character Replacement in ComfyUI”
4:221:26Configuring Mocha Embeds in ComfyUIThe creator demonstrates how to set up the Mocha Embeds node in ComfyUI, connecting the VAE model, reference video, first-frame mask, and character reference images.ComfyUI· AI Image Generator
5:500:25Processing reference video for MochaThe video shows how to use the Load Video and Image Scale nodes to prepare the reference video frames and prevent RAM overflow.ComfyUI· AI Video Editor
6:150:37Creating a single-frame mask with SAM 2CurrentThe demo shows how to use the Point Editor and SAM 2 nodes to generate a mask for only the first frame of the video, as required by Mocha.ComfyUI· AI Video Editor
6:520:39Preparing character reference imagesThe creator demonstrates resizing and padding a target character image to match the video aspect ratio using color padding to avoid distortion.ComfyUI· AI Expand Image
8:521:04Replacing a dancing character with MochaA concrete demonstration of replacing a woman dancing in a video with a new character using the Mocha workflow in ComfyUI.ComfyUI· Video to Video
12:450:58Replacing a human with an animated werewolfThe video demonstrates replacing a human actor with a stylized werewolf character while maintaining consistent textures and movement.ComfyUI· Video to Video
13:431:00Lip sync character replacement with MochaThe creator shows Mocha's ability to sync the lip movements of a new character (both human and animated) with the original video's audio.ComfyUI· AI Lip Sync Generator- Watch “Mocha vs Wan2.2 Animate: Best Workflow for PERFECT Character Replacement in ComfyUI” →
AI Video Editor
14:113:23Segmenting video characters with green and red dotsA detailed walkthrough of using the segmentation tool in ComfyUI to define which character to replace by placing positive (green) and negative (red) points.AI Search
20:540:27Modifying ComfyUI nodes for single video outputThe user demonstrates how to bypass the concatenation node to output only the generated video instead of a side-by-side comparison.AI Search
5:500:25Processing reference video for MochaThe video shows how to use the Load Video and Image Scale nodes to prepare the reference video frames and prevent RAM overflow.SOTAI
6:150:37Creating a single-frame mask with SAM 2CurrentThe demo shows how to use the Point Editor and SAM 2 nodes to generate a mask for only the first frame of the video, as required by Mocha.SOTAI
ComfyUI