Nodes/ComfyUI-vlo/LTX Set Audio Latent Binary Masks
ComfyUI Node

LTX Set Audio Latent Binary Masks

Put silence (or sound) exactly where you want it in LTX's audio latent

By PxTicks·Created 4 months ago·Updated 10 days ago· 0
LTX Set Audio Latent Binary Masks
  • audio_latent
  • masks
  • audio_latent
threshold0.50
resize_modenearest
existing_mask_modeoverwrite

LTX-2 and 2.3 do something no other open-weights video model does: they generate the video and the soundtrack in one pass. That audio lives in its own latent space, with its own noise_mask - the same trick ComfyUI uses to tell a video sampler "regenerate here, leave the rest alone," but for sound. LTX Set Audio Latent Binary Masks is the node that builds that audio noise mask from a mask you can actually see, so you get to decide which moments of the soundtrack get regenerated and which get pinned down.

That is audio inpainting, and it's the honest reason this node exists. vlo (the video editor these nodes ship for) uses it in its default workflows to scrub bad sounds, add foley where the action is, or hold a voice track steady while the picture changes. If you're hand-building an LTX-2 audio+video pipeline, it's the missing piece between "mask drawn on the timeline" and "audio latent with a noise mask."

How it works

The clever part is what it throws away. Feed it a binary mask image or mask video, and each frame is reduced to a single active/inactive value: if any pixel in the frame meets the threshold (default 0.5), that frame counts as active. The spatial shape of your mask is deliberately ignored - an audio latent has no spatial dimensions to map it onto, so only the temporal extent matters.

That one-pixel-tall timeline is then resized along time to match the audio latent's frame count, re-thresholded to hard 0/1, and broadcast across the whole latent. What comes out is a binary mask that says "denoise this temporal chunk, hold this one."

The inputs that actually matter:

  • audio_latent - the LTX audio latent whose noise_mask you're setting.
  • masks - your mask image or mask video. More frames = finer control over the timeline.
  • threshold (default 0.5) - how bright a pixel must be to mark its frame active.
  • resize_mode (default nearest) - nearest keeps hard ranges, linear smooths transitions before the final 0.5 cut. For crisp on/off silence, keep nearest.
  • existing_mask_mode (default overwrite) - add takes the max with an existing mask, subtract clears the masked regions out of it.

One output: the same audio_latent, now carrying the noise_mask. Wire it straight into the sampler the same way you'd wire any latent with a mask.

The gotchas

This is a temporal node, so a single still mask image activates the entire clip (or none of it) - you need one mask frame per audio moment you care about. If the audio latent isn't a 4D [B, C, F, S] tensor you'll get a clear error; that shape is exactly what LTX's audio encoders produce, so if you're feeding a video latent in by mistake, that's your warning. And remember subtract clears regions - it's for carving holes out of an existing mask, not layering one on.

Install

It ships in the ComfyUI-vlo pack, so it installs with the rest of them:

cd ComfyUI/custom_nodes
git clone https://github.com/PxTicks/ComfyUI-vlo.git

Restart ComfyUI (or hit refresh in ComfyUI Manager, which can install it as "ComfyUI-vlo"). No models to download, nothing extra to pip install - recent ComfyUI already bundles the video stack this leans on.

Categorylatent/audio

Inputs (5)

NameTypeDefaultDescription
audio_latentLATENTAudio latent whose noise_mask will be set.
masksMASKBinary mask image or mask video. Only the temporal activity of each frame is used; spatial dimensions are ignored after thresholding.
thresholdFLOAT0.500–1Per-pixel threshold used when deciding whether a mask frame is active. If any pixel in a frame meets this threshold, that frame activates audio masking.
resize_modeCOMBOnearestHow to resize the derived binary timeline to the audio latent length. 'nearest' preserves hard ranges; 'linear' smooths transitions before the final binary threshold.
existing_mask_modeCOMBOoverwriteHow to combine with an existing audio noise mask. 'overwrite' replaces it, 'add' takes the max, and 'subtract' clears masked regions.

Outputs (1)

NameTypeDescription
audio_latentLATENT