Nodes/ComfyUI-LTXVideo/πŸ…›πŸ…£πŸ…§ LTXV Preprocess Masks
ComfyUI Node Runs on cloud

πŸ…›πŸ…£πŸ…§ LTXV Preprocess Masks

Get your masks into LTX's latent space

By LightricksΒ·Created 2 years agoΒ·Updated about a month agoΒ· 3,956
πŸ…›πŸ…£πŸ…§ LTXV Preprocess Masks
  • masks
  • vae
  • MASK
β—„invert_input_masksfalseβ–Ί
β—„ignore_first_masktrueβ–Ί
β—„pooling_methodmaxβ–Ί
β—„grow_mask0β–Ί
β—„tapered_cornerstrueβ–Ί
β—„clamp_min0.50β–Ί
β—„clamp_max1.00β–Ί

If you're doing inpainting or region-conditioning with LTX and your mask "sort of" works but the edges are mushy or off, this is the node you were missing. A pixel-space mask doesn't line up with LTX latents, because the LTX VAE compresses hard in both space and time. This node does the translation - it turns your full-resolution masks into masks that actually match the latent the model is working on.

How it works

LTX's VAE is the whole reason the model is fast: it packs many pixels and several frames into each latent element. That aggressive compression is also why a naive mask fails - one latent cell covers a chunk of your image and a span of frames, so you can't just resize a mask down and hope. This node pools your masks down into latent resolution using a method you choose, then cleans up the result so it's a usable latent-space mask. The description says it plainly: preprocess masks to be used for masking latents in the LTXVideo model.

The inputs that matter

  • masks and vae - your input masks and the LTX VAE, which the node needs to know the compression geometry.
  • pooling_method (default max) - how a block of pixels collapses into one latent cell. max errs toward keeping the mask (safest for "don't lose the edge"), mean softens, min shrinks.
  • grow_mask (default 0) - dilate or shrink the mask; positive grows it outward, which is usually what you want so edits blend.
  • clamp_min / clamp_max (defaults 0.5 / 1) - normalize the mask's value range so soft masks don't come out weak.

There's also invert_input_masks, ignore_first_mask (on by default - the first frame is often your conditioned keyframe, so you leave it alone), and tapered_corners for the grow shape. The single output is a MASK ready to feed a masked-conditioning or inpaint node.

Installing it

  • ComfyUI Manager - search LTXVideo, install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/Lightricks/ComfyUI-LTXVideo, then restart.

Common issues

Edits bleed past the mask, or leave a hard seam. Grow the mask a little with grow_mask and keep tapered_corners on so the boundary feathers instead of stair-stepping.

The mask comes out too weak to do anything. That's the value range - raise clamp_min. A mask that tops out at 0.5 barely conditions.

The first frame won't take an edit. ignore_first_mask defaults on, deliberately, because the first frame is usually your anchor. Turn it off if you genuinely need to mask frame zero.

Detail's still slightly off temporally. Remember the mask is being pooled across frames too, not just pixels. For a moving subject you often want to grow it and pair it with the Dilate Video Mask node so the coverage tracks motion across the clip.

CategoryLightricks/mask_operations

Inputs (9)

NameTypeDefaultDescription
masksMASKβ€”
vaeVAEβ€”
invert_input_masksBOOLEANfalseInvert the input masks before processing.Useful for masking vs unmasking operations.
ignore_first_maskBOOLEANtrueZero out the first mask, typically used whenit corresponds to the conditioning frame.
pooling_methodCOMBOmaxMethod to combine temporal masks. Max preserves strongest values, mean averages them, min takes weakest values.
grow_maskINT0-16384–16384Pixels to grow (positive) or shrink (negative) the mask.Uses morphological operations.
tapered_cornersBOOLEANtrueUse tapered corners in morphological operations for smoother mask edges.
clamp_minFLOAT0.500–1Minimum value to clamp masks to, ensuring minimum opacity.
clamp_maxFLOAT1.000–1Maximum value to clamp masks to.

Outputs (1)

NameTypeDescription
MASKMASKβ€”