ComfyUI SAM 3.1 + LTX 2.3 video object swap tutorial
Learn text and click masking in ComfyUI with SAM and LTX 2.3, including block sizes of 64 and 8 and a workaround for audio extraction errors.
Player not loading? Watch on YouTube
This tutorial explains a ComfyUI workflow that combines Segment Anything masks with LTX 2.3 and an inpainting add-on to replace objects in video. The speaker describes SAM 2 as the manual selection route and SAM 3.1 as the text-driven route. A switch lets users choose between typing an object description and clicking a specific subject when a description is ambiguous.
The workflow grows the mask slightly and softens its edges before passing it, the original clip and a reference image to the video model. The speaker says the replacement preserves the surrounding scene, lighting and camera motion; these are claims about the demonstrated workflow rather than guarantees for every clip.
Two examples explain block size. A Porsche-to-Honda swap uses 64 to allow a different vehicle shape. A jumping character replacement uses 8 to retain finer movement. The speaker also recommends matching the reference image angle to the footage.
Setup covers model links from Hugging Face and GitHub, file placement and loader selection. For clips without audio, the tutorial advises bypassing the get audio node if extraction fails. The speaker provides the workflow through Patreon. The supplied material does not specify hardware requirements or render times.