Nodes/ComfyUI-LTXVideo-AVSplit/🅛🅣🅧 Stitch AV Latents
ComfyUI Node

🅛🅣🅧 Stitch AV Latents

Stitch two LTX-2 clips in latent space — and keep the audio in sync

By PsypmP·Created 5 months ago·Updated 5 months ago· 0
🅛🅣🅧 Stitch AV Latents
  • av_latent_1
  • av_latent_2
  • model
  • vae
  • audio_vae
  • av_latent
video_fps24.0
bridge_latent_frames1
stitch_modebridge
overlap_latent_frames16
video_pre_frames0
video_post_frames0
video_slope_len0
mask_videotrue
video_mask_init_value0.0
audio_start_time0.0
audio_end_time10.0
audio_slope_len3
mask_audiotrue
audio_mask_init_value0.0
audio_mask_bridge_onlyfalse
bridge_init_modelerp

LTX-2's whole selling point is synchronized audio and video, but each generation is short, and the community's standard move for anything longer is to generate clips and join them. Splicing two MP4s in a video editor is easy. Joining two latents before the final denoise is the trickier part - and it's the part worth doing, because it lets the model invent a seamless transition across the seam instead of leaving you with a hard cut and a re-encode. That's exactly what this node is for.

What it does

It takes two AV latents (av_latent_1, av_latent_2) and stitches them, building a transition region and the masks that tell the sampler "regenerate this seam, leave the clips alone." There are two video modes:

  • bridge (default) - inserts a separate transition segment between the clips, so clip → transition → clip.
  • overlap_linear_video - linearly blends the tail of clip 1 with the head of clip 2 and replaces the overlap.

The important asymmetry is in the name: audio always stitches via a bridge, even in the overlap video mode. The audio bridge's length is derived from bridge_latent_frames × temporal stride / fps, converted to audio latent frames using the audio VAE's latent rate - so your sound stays aligned with the video transition instead of drifting, which is the classic failure when people extend LTX-2 clips by just concatenating.

How the transition gets filled

The bridge latents are initialized by bridge_init_mode, and this is the one input that actually changes the character of the result:

  • lerp - linear interpolation between the last frame of clip 1 and the first frame of clip 2. Predictable, and the model just refines it. The safe default.
  • noise - random Gaussian, the model generates the whole bridge from scratch. More freedom, more dice rolls.
  • zeros - a neutral zero latent. You rarely want this one.

Masks are then built around the transition window: video_pre_frames / video_post_frames expand the mask before and after the seam in latent frames, video_slope_len softens its edges, and mask_video + video_mask_init_value toggle it on/off and set the base. Audio gets the same treatment via audio_start_time/audio_end_time/audio_slope_len - unless you flip audio_mask_bridge_only, which ignores the seconds entirely and masks exactly the inserted audio bridge, so only the bridge audio gets denoised and the audio of both clips stays untouched. That flag is the difference between "fix the seam" and "unwittingly re-roll a chunk of my finished clip."

Wire the optional vae and audio_vae in for exact sync - if you omit them it falls back on the LTX-2 defaults (temporal stride 8, ~25 audio latents/sec), which is fine until it isn't.

The inputs that matter

  • stitch_mode - bridge vs. overlap; pick by whether you want a dedicated transition or a blend.
  • bridge_latent_frames - transition length in latent frames (≈8 frames per video second at 24fps, given stride 8).
  • bridge_init_mode - lerp for control, noise for creativity.
  • audio_mask_bridge_only - protect your clip audio; enable it once the seam sounds right.

Output is a single av_latent for your sampler.

Install

Same pack, same story: ComfyUI Manager → search ComfyUI-LTXVideo-AVSplit, or

cd ComfyUI/custom_nodes
git clone https://github.com/PsypmP/ComfyUI-LTXVideo-AVSplit
pip install -r ComfyUI-LTXVideo-AVSplit/requirements.txt
# restart ComfyUI

numpy is the whole dependency list. No model files - it operates on latents you already have.

Troubleshooting

Audio desync is the community-documented villain when extending LTX-2 clips - it shows up in threads about long generations constantly. If your seam's sound drifts, the fix is usually a longer bridge (more latent frames = more runway for the audio bridge to land) and audio_mask_bridge_only on. A too-short bridge reads as a hard cut; a too-long one starts inventing content you didn't ask for. And if you're running the official ComfyUI-LTXVideo pack alongside this one, watch the near-identical node names in the search bar - make sure you're grabbing the right registration. The node also demands an LTXAVModel with NestedTensor latents, same as its sibling in this pack, so it won't do anything useful on plain video latents.

Categorylightricks/LTXV

Inputs (21)

NameTypeDefaultDescription
av_latent_1LATENT
av_latent_2LATENT
modelMODEL
video_fpsFLOAT24.00–500Decoded video FPS. Each video latent step spans (temporal_stride / fps) seconds; optional vae/audio_vae override stride and audio rate.
bridge_latent_framesINT11–4096Bridge length in video latent frames when stitch_mode='bridge'. In stitch_mode='overlap_linear_video' it does not affect video; it only controls audio bridge duration.
stitch_modeCOMBObridgeHow to stitch video latents: 'bridge' inserts transition latents between clips (existing behavior); 'overlap_linear_video' linearly blends overlapping tail/head and replaces overlap. Audio always uses bridge stitching.
overlap_latent_framesINT161–4096Overlap size for stitch_mode='overlap_linear_video', in video latent frames. Ignored when stitch_mode='bridge'.
video_pre_framesINT00–4096Video mask expansion before the transition region, in latent frames (used when mask_video=True).
video_post_framesINT00–4096Video mask expansion after the transition region, in latent frames (used when mask_video=True).
video_slope_lenINT00–100Video mask slope length around the transition window, in latent frames (used when mask_video=True).
mask_videoBOOLEANtrue
video_mask_init_valueFLOAT0.00–1
audio_start_timeFLOAT0.00–2000Audio mask start time in seconds (used when mask_audio=True).
audio_end_timeFLOAT10.00–2000Audio mask end time in seconds (used when mask_audio=True).
audio_slope_lenINT31–100Audio mask slope length in latent frames (used when mask_audio=True).
mask_audioBOOLEANtrue
audio_mask_init_valueFLOAT0.00–1
audio_mask_bridge_onlyBOOLEANfalseIf enabled, ignore audio_start_time/audio_end_time and mask exactly the inserted audio bridge so only bridge audio is denoised. audio_slope_len is applied inside the bridge and never bleeds into clip 1 / clip 2 audio.
bridge_init_modeCOMBOlerpHow to initialize bridge latents. For video this is used only when stitch_mode='bridge'. In stitch_mode='overlap_linear_video' it affects only audio bridge initialization. 'lerp': linear interpolation between endpoints (original). 'noise': random gaussian noise (model generates from scratch). 'zeros': zero-filled (neutral latent).
vaeoptVAEIf set, video temporal stride = downscale_index_formula[0]. If omitted, uses default 8 (LTX-2).
audio_vaeoptVAEIf set, audio latent steps/sec from the VAE. If omitted, uses ~25 (LTX-2). Wire both for exact sync if your VAE differs.

Outputs (1)

NameTypeDescription
av_latentLATENT