--- tags: - ahead-of-time - pytorch - ltx-2.3 - zerogpu library_name: diffusers base_model: diffusers/LTX-2.3-Diffusers --- # LTX-2.3 Transformer — AOTI build (in-context, **with self-attention mask**) Ahead-of-time **precompiled** `transformer_blocks` of `LTX2VideoTransformer3DModel` for **ZeroGPU (sm120 / cu130)**. The package is the compiled **graph only — no weights**, so it works with: - the **base** *and* **distilled** LTX-2.3 (identical architecture), and - **any LoRA**, as long as it's **fused** into the transformer (`fuse_lora`, not `set_adapters`). Dynamic over video- and audio-token counts → one binary serves **any resolution / frame count / duration**. Compiled for the `LTX2InContextPipeline` audio+video forward. ## When to use this repo - **This build:** in-context demos that pass a `conditioning_attention_mask` (equivalently `conditioning_attention_strength < 1.0`) — e.g. **inpaint, outpaint**. - Demos that **don't** pass that mask → use [`ltx-community/LTX-2.3-Transformer-GroupA-sm120-cu130-r9e`](https://huggingface.co/ltx-community/LTX-2.3-Transformer-GroupA-sm120-cu130-r9e). - STG (`stg_scale>0`, perturbs only block 28) is **not** supported by this uniform per-block build. ## Use it (ZeroGPU) — load at the **root module level** ```python import spaces, torch from diffusers import LTX2InContextPipeline pipe = LTX2InContextPipeline.from_pretrained( "diffusers/LTX-2.3-Distilled-Diffusers", torch_dtype=torch.bfloat16 ).to("cuda") # fuse your IC-LoRA (the AOTI graph is weight-agnostic, but the LoRA must be FUSED, not set_adapters) pipe.load_lora_weights(my_lora_state_dict, adapter_name="x") pipe.fuse_lora(lora_scale=1.0) pipe.unload_lora_weights() # load the precompiled blocks AT ROOT LEVEL (ZeroGPU loads on cuda at module scope; do NOT # lazy-load or move to cuda inside @spaces.GPU — see the ZeroGPU model-loading docs) spaces.aoti_load(module=pipe.transformer, repo_id="ltx-community/LTX-2.3-Transformer-GroupB-sm120-cu130-r0e") @spaces.GPU def generate(*args, **kwargs): return pipe(*args, **kwargs) # nothing AOTI-related in here ``` Public repo (graph only) → no token needed. Built with the job in this repo's `job.py`. ## How to reproduce or customize This repo bundles the `job.py` that built it. To rebuild (or retarget to another GPU arch / base model), download it and run on HF Jobs: ```bash hf jobs uv run job.py \ --flavor rtx-pro-6000 \ --image pytorch/pytorch:2.9.1-cuda13.0-cudnn9-devel \ --secrets HF_TOKEN ``` Customize the output repo name with `OUTPUT_REPO_BASE_NAME` / `OUTPUT_REPO_ID`, and set `LTX_GROUP_B=1` (this build adds the in-context self-attention mask). The exact build environment (torch 2.12.0+cu130, etc.) is recorded in `environment.json`. ## Job run - [linoyts/6a3270a3fb114ff24a388567](https://huggingface.co/jobs/linoyts/6a3270a3fb114ff24a388567)