返回
Change Any Objects

The 'Change Any Objects' workflow in ComfyUI is designed to facilitate the seamless replacement of objects within a video using simple prompts. This is achieved through a combination of advanced inpainting techniques and video processing models. The workflow utilizes the SAM3 model for video segmentation and the WAN 2.1 VACE model for inpainting, allowing users to mask out specific objects in a video and replace them with new elements defined by text prompts or optional reference images. The workflow leverages a series of nodes such as WanVideoDecode for video decoding, SAM3VideoSegmentation for object segmentation, and WanVideoSampler for sampling, ensuring a smooth and efficient process. By integrating these nodes, users can achieve high-quality video edits that appear natural and cohesive.

Technically, the workflow operates by first loading the video and segmenting it into frames using the SAM3 model. The segmentation process identifies and masks the target objects, which are then replaced using the WAN 2.1 VACE model's inpainting capabilities. This model is particularly effective due to its ability to understand and replicate the video's context, ensuring the new objects blend seamlessly with the existing footage. The workflow also includes nodes for adjusting settings, such as the INTConstant for setting constants and VHS_VideoCombine for combining processed frames back into a video. This makes the workflow highly versatile and useful for a range of video editing applications, from simple object replacements to complex scene alterations.