ComfyUI Node

CS VideoMaMa

Turn coarse per-frame binary masks into soft video mattes with VideoMaMa. Inference runs inside the mask bounding box at a reduced working size, one pass covers as many frames as the free VRAM affords, and passes are joined through a short seam that feeds each pass the previous pass's own soft output. Output keeps the input frame count, order and resolution.

By chflame163·Created 2 months ago·Updated 5 days ago· 79
CS VideoMaMa
  • image
  • mask
  • MASK
◄deviceauto►
◄seed42►
◄batch_overlap2►
◄max_resolution1280►
◄motion_bucket_id127►
◄cpu_offloadfalse►
◄force_unload_modelfalse►
Category😺dzNodes/CineStyle

Inputs (9)

NameTypeDefaultDescription
deviceCOMBOautoauto follows whatever device ComfyUI is currently using.
seedINT420–18446744073709550000Drives both the UNet noise and the VAE posterior sample, so the same seed reproduces a clip bit for bit. The global RNG is snapshotted and restored, so other nodes in the workflow are unaffected.
imageIMAGEVideo frames as a ComfyUI IMAGE batch.
maskMASKMatched per-frame coarse masks; one shared mask broadcasts to every frame. Binarised at 0.5, so feathered edges are discarded.
batch_overlapINT20–32Frames two consecutive passes share. They are re-predicted from the previous pass's soft alpha, then cross-faded; 2 is enough because of that feedback. 0 disables both and leaves visible seams. Capped at half the pass length: a wider seam re-predicts more than half of every pass, which costs more than it buys.
max_resolutionINT1280256–2048Cap on the longest side of the region actually fed to the model. This is the main speed control, since pixel count decides how many frames fit in one pass. Output always returns to the source resolution.
motion_bucket_idINT1271–255SVD motion conditioning, not the clip's real motion. Lower (50-100) = subtle, higher (150-200) = dynamic. Leave at 127 unless edges flicker.
cpu_offloadBOOLEANfalseKeep weights in RAM and move them per stage. Saves VRAM but costs a transfer per pass, a poor trade once a clip needs many passes.
force_unload_modelBOOLEANfalseRelease the models when this run ends so other nodes can take the VRAM back. ComfyUI does not track these diffusers modules by itself.

Outputs (1)

NameTypeDescription
MASKMASK—