Fix VAE encoder broadcast error for LTX-2.3 I2V#24
Open
nopmobiel wants to merge 1 commit intoBlaizzy:mainfrom
Open
Fix VAE encoder broadcast error for LTX-2.3 I2V#24nopmobiel wants to merge 1 commit intoBlaizzy:mainfrom
nopmobiel wants to merge 1 commit intoBlaizzy:mainfrom
Conversation
The SpaceToDepthDownsample skip connection computed channel counts from self.out_channels, but LTX-2.3 converted weights (prince-canuma/LTX-2.3-distilled) have conv output channels that don't match out_channels // multiplier for the last downsample block (128 vs 256), causing a broadcast shape error: ValueError: Shapes (1,1024,1,8,12) and (1,2048,1,8,12) cannot be broadcast This only affects I2V (image-to-video) since T2V doesn't use the VAE encoder. Fix: derive the skip connection channel count from the actual conv output shape instead of the configured out_channels. This is backwards-compatible with LTX-2 weights where the values already match. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
SpaceToDepthDownsamplebroadcast shape error when using LTX-2.3 converted weights for image-to-video (I2V) generationout_channelsProblem
When running I2V with
prince-canuma/LTX-2.3-distilled, the VAE encoder crashes:The last
compress_all_resdownsample block has conv weights with 128 output channels, butout_channels // multipliercomputes 256. After space-to-depth this becomes 1024 vs 2048.T2V works fine since it doesn't use the VAE encoder.
Fix
In
SpaceToDepthDownsample.__call__, compute the conv branch first and derive the skip connection's reshape dimensions from the actual output rather thanself.out_channels. This handles weight/config mismatches in converted models while remaining compatible with LTX-2.Test plan
prince-canuma/LTX-2.3-distilled— generates successfully