vlo Mask to Latent Mask
Give video inpainting a pixel-space mask without fighting the VAE's time math
- latent
- vae
- masks
- latent_mask
So you've got a mask - drawn in an editor, or extracted by a segmentation model - and you want to feed it into ComfyUI's SetLatentNoiseMask so a video model regenerates just that region. If you've done this for images, it just works: resize to latent size, done. For video it quietly doesn't, because a latent frame isn't a pixel frame. Each latent time-step covers a range of source frames, and that range is different for LTX than for MiniMax H3, and it's not even uniform inside one encoder. vloMaskToLatentMask exists to make that mapping stop being your problem.
It's a pure helper from the ComfyUI-vlo pack (the utility collection that ships alongside PxTicks' vlo app), and it's the kind of small node that saves you an afternoon once you hit video inpainting. It takes three things: a latent (it only reads the dimensions - it never modifies or returns the latent), a vae, and your pixel-space masks, one per source video frame.
How it works
The node asks the VAE which source frames feed each latent frame - handling LTX's chunked temporal encoding and MiniMax H3's clip geometry by reading the model directly, not by assuming a flat frames-per-latent ratio - then pools those source frames together. That pooling is the pooling_method input, and it's the one widget you'll actually think about: max (the default) keeps the region masked if any frame in the range had it masked, which is what you want when a subject moves through a few frames; mean softens it; min only keeps what was masked in every frame.
Spatially it then crops the way the VAE crops pixels and resizes to the latent's exact height/width with resize_mode (bilinear default, nearest-exact if you want hard edges). Output is a single latent_mask MASK shaped [latent_frames, latent_height, latent_width] - exactly what SetLatentNoiseMask expects, so wire it straight into that.
It's also AV-aware: if you pass a joint video+audio latent (the H3 and LTX AV latents are nested tensors), the mask is sized against the video stream and the audio stream stays unmasked, generating normally. Want to mask audio too? That's the pack's separate vlo Set Audio Latent Binary Masks node.
Where people get burned
The mask's frame count has to actually line up with the latent's, and the node refuses to fudge it. If your mask belongs to a different video, you'll get an error like "N source mask frame(s) map to M latent frame(s), but the latent has K" rather than a silently-wrong result. That's deliberate - resampling a mask from the wrong video produces a correctly-shaped mask with the wrong meaning. If you see it, check that the mask covers the same clip (and same frame range) as the latent you're sampling.
Install
This is the whole pack, not a standalone node. Via ComfyUI Manager, search "ComfyUI-vlo", or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/PxTicks/ComfyUI-vlo.git
Then restart ComfyUI. No Python dependencies beyond what ComfyUI already ships - there's no requirements.txt, nothing to pip install. One caveat: the repo is young (actively developed as of late 2026), so if Manager can't find it yet, the clone path above always works.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | Latent the mask must match. Only its dimensions are read; the latent itself is neither modified nor returned. Joint AV latents are accepted and sized against their video stream. | |
| vae | VAE | VAE used to encode the video. Supplies the mapping from source frames to latent frames. | |
| masks | MASK | Pixel-space mask sequence, one mask per source video frame. | |
| pooling_method | COMBO | max | How the source frames feeding one latent frame are combined. 'max' keeps anything masked in any frame, 'mean' averages, 'min' keeps only what is masked in every frame. |
| resize_mode | COMBO | bilinear | How the mask is resized to the latent's height and width. 'nearest-exact' keeps hard edges, 'area' averages coverage. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent_mask | MASK | Mask shaped [latent_frames, latent_height, latent_width], ready for SetLatentNoiseMask. |