Repository navigation
Description
System Info
TensorRT-LLM main at db98912. Reproduced in a CPU-only Python 3.12 / PyTorch 2.13 environment. The affected conversion is pure Python and does not require a GPU.
Who can help?
Visual generation / LTX-2 maintainers
Information
- The official example scripts
- My own modified scripts
Tasks
- An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - My own task or dataset (give details below)
Reproduction
SpatioTemporalScaleFactors stores fields as (time, width, height), but latent tensor coordinates and get_pixel_coords consume scale factors in (time, height, width) order. This swaps asymmetric spatial factors.
from tensorrt_llm._torch.visual_gen.models.ltx2.ltx2_core.types import (
SpatioTemporalScaleFactors,
VideoLatentShape,
VideoPixelShape,
)
scale = SpatioTemporalScaleFactors(time=2, height=4, width=8)
pixel = VideoPixelShape(batch=1, frames=9, height=16, width=32, fps=24.0)
latent = VideoLatentShape.from_pixel_shape(pixel, scale_factors=scale)
print(latent[2:])
print(latent.upscale(scale)[2:])On current main this prints (5, 2, 8) and the upscale does not round-trip to (9, 16, 32). The mismatch is hidden by the default symmetric height=width=32 factors.
Expected behavior
The scale factors should follow tensor-axis order (time, height, width). The example should produce latent dimensions (5, 4, 4), and upscaling should return (9, 16, 32).
actual behavior
Current main swaps the spatial divisors, producing latent dimensions (5, 2, 8). VideoLatentShape.upscale() then uses the named height and width values, so the conversion is not its own inverse for asymmetric factors.
additional notes
I traced the same tuple directly into get_pixel_coords, which multiplies axes in time/height/width order. A minimal fix is to define the tuple fields as time, height, width and use named fields in from_pixel_shape. I also prepared a regression test covering asymmetric conversion, round-trip behavior, and patchifier coordinate mapping; all direct checks pass.
Before submitting a new issue...
- Make sure you already searched for relevant issues, and checked the documentation and examples for answers to frequently asked questions.
Activity
[#19495][fix] Align LTX-2 scale factors with tensor axes (#19500)