demobook

ComfyUI: Segmenting video characters with green and red dots

Demo summary

A detailed walkthrough of using the segmentation tool in ComfyUI to define which character to replace by placing positive (green) and negative (red) points.

Step-by-step

  1. Upload your source video to the video node.
  2. Set the frame load cap to zero if you want to process the entire video.
  3. Upload a mandatory reference image of your character to the Ref 1 node.
  4. Press Run to generate the initial segmentation mask.
  5. Drag green dots onto the character areas you want to include.
  6. Drag red dots onto objects or background areas you want to exclude.
  7. Press Run again to update the mask and repeat adjustments until the character is correctly segmented.

Options

  • Set frame load cap to a specific number (e.g., 81) to cut the video at a certain point.
  • Click the question mark icon to view explanations for all settings.
  • Enable the optional Ref 2 component to upload an additional reference image.

Watch out for

  • The Ref 1 image is mandatory for the process to work.
  • If the frame load cap is not set to zero, the video will be truncated based on the frame count.

Tips

  • Use a reference image with a clean background or remove the background first to avoid artifacts.
  • Upload a close-up face image to Ref 2 to enhance facial fidelity in the output.
  • Bypass later nodes in the workflow to focus on getting the segmentation mask right first.
  • Place green dots on specific accessories like headphones if you want them included in the mask.
  • Place red dots directly on overlapping objects (like microphones) to cleanly separate them from the character.

Highlights

I'm intentionally showing you this example because the segmentation is a bit trickier.

All demos from “This AI video tool gives you total control. Free & offline

  1. 0:000:54Mocha character replacement showcaseThe video demonstrates Mocha's ability to replace characters in existing videos with new characters from reference images while maintaining original movements and lighting.ComfyUIVideo to Video
  2. 2:280:44Swap human character for 3D Pixar model in MochaThe creator demonstrates swapping a real person in a video with a 3D Pixar-style character using Mocha, showing the transfer of lip movements and hand gestures.ComfyUIVideo to Video
  3. 3:120:44Anime character replacement with MochaA demonstration of replacing one anime character with another using a reference image, highlighting the tool's performance on complex outfits and hair.ComfyUIAI Inpainting
  4. 7:180:53Loading Mocha workflow in ComfyUIThe user demonstrates how to drag and drop a JSON workflow file into the ComfyUI interface to automatically build the Mocha node structure.ComfyUIAI Image Generator
  5. 13:000:48Configuring Mocha model nodes in ComfyUIThe creator shows how to select the specific Mocha, VAE, and text encoder models within the ComfyUI node dropdown menus.ComfyUIAI Image Generator
  6. 14:113:23Segmenting video characters with green and red dotsCurrentA detailed walkthrough of using the segmentation tool in ComfyUI to define which character to replace by placing positive (green) and negative (red) points.ComfyUIAI Video Editor
  7. 20:110:27Generating final character swap videoThe video shows the K-Sampler process and the final rendered output of a character replacement task within ComfyUI.ComfyUIVideo to Video
  8. 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.ComfyUIAI Video Editor
  9. Watch “This AI video tool gives you total control. Free & offline” →

AI Video Editor

  1. 14:113:23Segmenting video characters with green and red dotsCurrentA 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
  2. 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
  3. 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
  4. 6:150:37Creating a single-frame mask with SAM 2The 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