Skip to content

vllm_omni.diffusion.models.ltx2.ltx2_adapter_parser

Parse official LTX distilled adapters without materializing their tensors.

The official LTX adapters are raw safetensors files rather than PEFT checkpoints. This module is deliberately LTX-specific: it translates the official names into the locally constructed Diffusers transformer names and describes the resulting adapter targets. Applying those targets is the job of :mod:ltx2_phase_adapter.

AdapterManifest dataclass

Tensor-free description of the fixed refinement adapter.

path instance-attribute

path: str

targets instance-attribute

targets: tuple[AdapterTarget, ...]

AdapterTarget dataclass

One A/B pair mapped onto a local transformer linear layer.

a_key instance-attribute

a_key: str

a_shape instance-attribute

a_shape: tuple[int, ...]

b_key instance-attribute

b_key: str

b_shape instance-attribute

b_shape: tuple[int, ...]

module instance-attribute

module: str

slice instance-attribute

slice: str | None

source_module instance-attribute

source_module: str

iter_adapter_tensors

iter_adapter_tensors(
    manifest: AdapterManifest,
) -> Iterator[tuple[AdapterTarget, Tensor, Tensor]]

Stream adapter pairs in manifest order without a full checkpoint copy.

parse_ltx_adapter

parse_ltx_adapter(
    transformer: Module, path: str
) -> AdapterManifest

Translate one official raw LTX adapter into local Transformer targets.