Nodes/RES4LYF/ClownGuides VideoAudio Mask
ComfyUI Node Runs on cloud

ClownGuides VideoAudio Mask

Mask a video by time range for guided sampling

By ClownsharkBatwing·Created 2 years ago·Updated 22 days ago· 1,222
ClownGuides VideoAudio Mask
  • latent
  • spatial_mask
  • mask
model_typeLTXV
start_time0.00
end_time10.00
video_fps24.0
mask_videotrue
mask_audiofalse
video_init_value0.00
audio_init_value0.00

This is the temporal masking node for RES4LYF's video work. Its own description sums it up: it creates a flat mask for packed latents to target video (or audio) components by time range. In plain terms, you tell it "steps 2 through 5 seconds of this clip," and it builds a mask that a RES4LYF guide can use to apply an effect only to that stretch of the timeline - the video equivalent of drawing a region mask, but along time instead of space.

It exists because modern video models pack a lot into one latent. LTXV and Wan latents aren't just frames; they can bundle video and, in some setups, audio together in a nested structure. A normal 2D mask can't address "the middle two seconds" or "the audio but not the video." This node speaks that packed format and turns a time range into a proper mask you can wire into the guide system - which is what makes RES4LYF's frame-by-frame temporal conditioning on Wan possible.

How it works

You give it the video latent and tell it the model type, the time window you care about, and the clip's frame rate. It figures out which slices of the packed latent fall inside that window and builds a MASK marking them. You choose whether the mask targets the video component, the audio component, or both, and what value the un-targeted parts get. The result is an ordinary MASK output - this node doesn't guide anything itself, it feeds the guide and regional-conditioning nodes that do.

The inputs and output that matter

  • latent (LATENT) - the packed video latent you're masking.
  • model_type (enum: LTXV, Wan; default LTXV) - must match the model that produced the latent, because the packing differs. Get this wrong and the mask lands on the wrong slices.
  • start_time / end_time (FLOAT, seconds; default 0 and 10) - the time window to target.
  • video_fps (FLOAT, default 24) - the clip's frame rate, needed to convert seconds into latent frames. Set it to your actual fps.
  • mask_video / mask_audio (BOOLEAN; video on, audio off by default) - which component the mask covers.
  • spatial_mask (MASK, optional) - combine with a spatial region to mask in both time and space at once.

Output is a single mask (MASK), which you feed into a RES4LYF guide's mask input.

How to install it

ComfyUI Manager: search RES4LYF, install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/ClownsharkBatwing/RES4LYF/, pip install -r requirements.txt in your venv (portable ComfyUI: embedded python's pip), restart, hard-refresh with F5. You'll need a video model (Wan or LTXV) in the graph for the latents this masks. Nested sampler menu: rgthree-comfy with "Auto Nest Subdirectories" on.

Common issues

Two settings cause almost all the confusion, and they're related: model_type and video_fps. The mask is computed from the latent's packing layout and the frame rate, so if model_type doesn't match the model that made the latent, or video_fps doesn't match the clip's real rate, your time window maps to the wrong frames - the mask ends up covering, say, seconds 3–5 when you asked for 2–4. If a temporal effect is landing at the wrong moment, check these first, not the guide.

Also mind the audio toggle. mask_audio is off by default, and audio is only present at all in setups that actually pack it; turning it on for a video-only latent won't magically create an audio track to mask. And remember this node is a means, not an end - it produces a mask, and nothing happens until that mask is wired into a guide or conditioning node that does the actual work. On its own it's invisible.

CategoryRES4LYF/sampler_extensions

Inputs (10)

NameTypeDefaultDescription
latentLATENTLatent with latent_shapes (from packed NestedTensor) to determine component boundaries
model_typeCOMBOLTXVModel type to set temporal compression and audio parameters
start_timeFLOAT0.000–10000Start time in seconds
end_timeFLOAT10.000–10000End time in seconds
video_fpsFLOAT24.00.1–500Video frames per second
mask_videoBOOLEANtrueApply mask to video component
mask_audioBOOLEANfalseApply mask to audio component
video_init_valueFLOAT0.000–1Initial mask value for video (outside time range)
audio_init_valueFLOAT0.000–1Initial mask value for audio (outside time range)
spatial_maskoptMASKOptional spatial mask. Single [H,W] broadcasts to all frames. Batch [T,H,W] applies per-frame with temporal interpolation to match frame count.

Outputs (1)

NameTypeDescription
maskMASK