OmnimatteZero_SM_KSampler
Erase a watermark (or a swan) from video without training
- model
- images
- mask
- positive
- negative
- video_bg
- video_new_bg
- images
Video object removal has always been the annoying cousin of image inpainting. You mask, you hope, and the model either leaves a ghost or rebuilds the whole frame wrong. OmnimatteZero takes a different route: it's a training-free method that separates a video into layers - clean background, plus foreground object with all its effects (shadows, reflections) - using only the self-attention of a pretrained video diffusion model. No new checkpoint, no fine-tuning.
OmnimatteZero_SM_KSampler is where that actually happens in smthemex's ComfyUI port. The Model node loads the LTX Video 0.9.7 pipeline; this node runs it. Feed it a video, mask the thing you want gone, and out comes a cleaned video.
What you feed it
The two inputs that matter:
- images - your video as IMAGE frames (a VHS video or the example's GetVideoComponents).
- mask - a rough mask of the thing you want out. A single frame works: it gets repeated across the whole clip. A per-frame mask video works too.
Everything else is tuning. width/height default to 768x512 and should stay multiples of 32 - the LTX VAE enforces that. num_frames defaults to 121, which is 15×8+1, and the 8 is the part to remember: LTX's VAE compresses 8 frames at a time, so valid frame counts are k×8+1. The node clamps to your input length anyway, but pick a valid number or you'll get a silent truncation. guidance_scale (3) and steps (25) behave like any sampler; the fewer steps you can get away with, the better, since every step is a full-video denoise.
block_num is the one to know if you've got 12GB or less. It controls block-level offloading of the transformer: small values (1–10) keep VRAM in check, and 0 falls back to whole-model CPU offload. The author's guidance: lower VRAM → 1–10, bigger cards → 0 or larger.
total_mask_mode is where the "Omnimatte" magic lives. Off, the node removes the object using your coarse mask. On, it runs self-attention maps to expand the mask to the object's shadows and reflections before separating - that's what makes a swan's reflection on the lake disappear too, not just the swan.
positive and negative are optional CONDITIONING inputs. You can ignore them entirely: the pack ships precomputed embeddings for the matting task, and leaving them unplugged is the intended path. They're there if you want to steer with your own conditioning.
The compose path
Connect video_bg (the original scene) and video_new_bg (a replacement background) and - importantly - flip compose_mode on the Model node, and this node instead composites the extracted foreground onto the new background. That's the "put your object on a different lake" mode. It works, and the README is honest that the effect is merely "normal." It's the experimental branch; don't judge the pack on it.
Output
images - your cleaned or composited video as IMAGE frames, ready for a VideoCombine node. In removal mode, that's the video with the object gone.
Install and troubleshooting
Same install as the Model node: ComfyUI Manager (search "ComfyUI_OmnimatteZero") or
cd ComfyUI/custom_nodes
git clone https://github.com/smthemex/ComfyUI_OmnimatteZero.git
…then restart and pip install -r requirements.txt. The "missing node" errors people hit right after install are almost always that requirements step - diffusers ≥ 0.31 and friends actually need to be installed.
Set expectations: the model files are heavy (the full 13B merge is multi-GB; the Q8_0 GGUF is the lighter route), and the method genuinely wants VRAM - 12GB with block_num tuning is the stated floor, and 64GB of system RAM helps with offloading. It's niche, so there's no polished one-click; the example workflow in the pack is your best starting point. When it works - removing a watermark or a cleanly-maskable object - it's one of the rare video tools that actually looks right.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| images | IMAGE | — | |
| mask | IMAGE | — | |
| width | INT | 768256–16384 | — |
| height | INT | 512256–16384 | — |
| num_frames | INT | 1218–16384 | — |
| guidance_scale | FLOAT | 3.01–50 | — |
| steps | INT | 251–1024 | — |
| seed | INT | 00–2147483647 | — |
| block_num | INT | 50–2147483647 | — |
| total_mask_mode | BOOLEAN | false | — |
| positiveopt | CONDITIONING | — | |
| negativeopt | CONDITIONING | — | |
| video_bgopt | IMAGE | — | |
| video_new_bgopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |