Skip to content

[Bug]: LTX-2 asymmetric scale factors swap height and width #19495

Closed

Description

@adenzhou1350

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 examples folder (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

  1. added
    bug
    on Sep 21, 2026
  2. added a commit that references this issue on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    VisualGenbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions