Fix LTX2 VAE widths and dynamic shift coverage - #3008
Open
bghira wants to merge 2 commits into
Open
Conversation
added 2 commits
August 6, 2026 13:21
Compute LTX2 decoder up-block input channels from the current decoder width and project mismatched inputs to the upsampler width before upsampling. This keeps non-nominal constant-width decoder configurations from sending tensors with the wrong channel count into the 3D upsampler path. Add tests for projection, projection skipping, and a compact decoder shape that previously failed with mismatched widths.
Add AST-based regression coverage that both LTX Video 2 text-to-video and image-to-video pipelines pass the actual video_sequence_length into calculate_shift. This guards against reverting to shape assumptions that undercount the packed video sequence when dynamic timestep shifting is enabled.
bghira
marked this pull request as ready for review
August 6, 2026 19:46
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds regression tests and adjusts the LTXVideo2 autoencoder upsampling path so channel dimensions align correctly during upsampling and decoding.
Changes:
- Add AST-based tests to ensure
calculate_shiftis invoked usingvideo_sequence_lengthin LTX2 pipelines. - Expand autoencoder unit tests to validate
LTX2VideoUpBlock3dchannel projection behavior and decoder constant-width configs. - Update
LTX2VideoUpBlock3dto project inputs to the upsampler width and adjust decoder up-block channel wiring.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/test_ltxvideo2_dynamic_shift.py | New regression test ensuring dynamic shift uses actual video sequence length. |
| tests/test_ltxvideo2_autoencoder.py | New tests covering up-block channel projection and decoder constant-width acceptance. |
| simpletuner/helpers/models/ltxvideo2/autoencoder.py | Adjust up-block conv_in channel logic and decoder up-block input channel computation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+666
to
+670
| upsampler_in_channels = out_channels * upscale_factor | ||
| if in_channels != upsampler_in_channels: | ||
| self.conv_in = LTX2VideoResnetBlock3d( | ||
| in_channels=in_channels, | ||
| out_channels=out_channels, | ||
| out_channels=upsampler_in_channels, |
| calls = _calculate_shift_calls(tree) | ||
|
|
||
| self.assertEqual(len(calls), 1) | ||
| self.assertEqual(ast.unparse(calls[0].args[0]), "video_sequence_length") |
Comment on lines
+27
to
+28
| self.assertEqual(len(calls), 1) | ||
| self.assertEqual(ast.unparse(calls[0].args[0]), "video_sequence_length") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes LTX Video 2 VAE decoder channel handling and adds regression coverage for dynamic-shift sequence length selection.
Details
Validation
.venv/bin/python -m unittest -v -f tests.test_ltxvideo2_autoencoder tests.test_ltxvideo2_dynamic_shift