🅛🅣🅧 Stitch AV Latents
Stitch two LTX-2 clips in latent space — and keep the audio in sync
- av_latent_1
- av_latent_2
- model
- vae
- audio_vae
- av_latent
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.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| av_latent_1 | LATENT | — | |
| av_latent_2 | LATENT | — | |
| model | MODEL | — | |
| video_fps | FLOAT | 24.00–500 | Decoded video FPS. Each video latent step spans (temporal_stride / fps) seconds; optional vae/audio_vae override stride and audio rate. |
| bridge_latent_frames | INT | 11–4096 | Bridge 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_mode | COMBO | bridge | How 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_frames | INT | 161–4096 | Overlap size for stitch_mode='overlap_linear_video', in video latent frames. Ignored when stitch_mode='bridge'. |
| video_pre_frames | INT | 00–4096 | Video mask expansion before the transition region, in latent frames (used when mask_video=True). |
| video_post_frames | INT | 00–4096 | Video mask expansion after the transition region, in latent frames (used when mask_video=True). |
| video_slope_len | INT | 00–100 | Video mask slope length around the transition window, in latent frames (used when mask_video=True). |
| mask_video | BOOLEAN | true | — |
| video_mask_init_value | FLOAT | 0.00–1 | — |
| audio_start_time | FLOAT | 0.00–2000 | Audio mask start time in seconds (used when mask_audio=True). |
| audio_end_time | FLOAT | 10.00–2000 | Audio mask end time in seconds (used when mask_audio=True). |
| audio_slope_len | INT | 31–100 | Audio mask slope length in latent frames (used when mask_audio=True). |
| mask_audio | BOOLEAN | true | — |
| audio_mask_init_value | FLOAT | 0.00–1 | — |
| audio_mask_bridge_only | BOOLEAN | false | If 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_mode | COMBO | lerp | How 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). |
| vaeopt | VAE | If set, video temporal stride = downscale_index_formula[0]. If omitted, uses default 8 (LTX-2). | |
| audio_vaeopt | VAE | If 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)
| Name | Type | Description |
|---|---|---|
| av_latent | LATENT | — |