wizard / code /ltx /README.md
yuzhewu207's picture
examples: LTX cases now fire duel, sea tornado, gargoyle->griffin transformation (replace lift and statue griffin)
6d23192 verified
|
Raw History Blame Contribute Delete
3.73 kB
# Wizard on LTX-2.5 (inference)
The same visual proxy and reference binding, trained as a rank-32 IC-LoRA on
[LTX-2.5](https://huggingface.co/Lightricks/LTX-2.5) (22B). The LoRA is
[`weights/ltx25_lora/lora_weights_step_10000.safetensors`](https://huggingface.co/datasets/yuzhewu207/wizard/tree/main/weights/ltx25_lora)
in the dataset repository. It uses the **earlier proxy format**: coarse scene geometry in pink / purple (height and depth)
plus skeletons, with no geometry tiers, world coordinates or memory. It is a bidirectional 30-step model (CFG 3), not the
real-time causal student, and it generates 241 frames (8 s at 30 fps) at 1024×576 in one pass.
**License.** Everything in this folder (the patch, `infer_ltx.py`, the config) and the LoRA weights are Derivatives of
LTX-2.x and are distributed under the [LTX-2.x Community License](LICENSE-LTX-2.x.txt), including its use restrictions
(Section 4, Attachment A), not under the license of the rest of this repository. Files we changed in LTX-2 carry a notice
at the top.
## Setup
```bash
# 1. LTX-2 at the commit we built on, plus our patch (slot-gated reference images, KV cache, causal mask, flexible strategy)
git clone https://github.com/Lightricks/LTX-2.git && cd LTX-2 && git checkout a95ab85
git apply ../Wizard/ltx/ltx2_wizard.patch
uv sync --extra natten # as in LTX-2's README
export LTX2_DIR=$PWD; cd ..
# 2. LTX-2.5 base weights (gated: accept the license on its model page and `hf auth login` first)
hf download Lightricks/LTX-2.5 --local-dir ckpt/ltx25 \
--include "diffusion_models/ltx-2.5-22b-dev-transformer-bf16.safetensors" \
"text_encoders/gemma4-12b-with-proj-ltx-2.5-bf16.safetensors" "vae/*"
export LTX_CKPT=$PWD/ckpt/ltx25
# 3. the Wizard LoRA and three ready-made cases
hf download yuzhewu207/wizard --repo-type dataset --local-dir hf_wizard \
--include "weights/ltx25_lora/*" "examples/ltx_*"
```
## Run
```bash
cd Wizard
L=../hf_wizard/weights/ltx25_lora/lora_weights_step_10000.safetensors
CUDA_VISIBLE_DEVICES=0 bash ltx/run_ltx_case.sh $L ../hf_wizard/examples/ltx_summon_fire_duel fire.mp4
```
One case takes about 8–17 minutes (and some minutes to load the 22B model) on one H200 and needs an almost free 141 GB card: the 241-frame dense attention mask
alone takes about 29 GB on top of the model. With `seed` from `case.json` the result should match the case's `output.mp4`: we checked this path (fresh LTX-2 clone + this patch + `run_ltx_case.sh`'s settings) reproduces our original output frame for frame.
| Case | What happens |
|---|---|
| `ltx_summon_fire_duel` | A wizard on a beach summons a fire spirit (`ref_a.png`) from a circle in the sand and fights it |
| `ltx_sea_tornado` | On a headland the camera turns to the sea; the wizard points his staff and three waterspouts rise from the sea (geometry edit in the proxy) |
| `ltx_transform_gargoyle_griffin` | In front of a castle a witch summons a gargoyle (`ref_a.png`), stone steps rise beside her, and the gargoyle turns into a griffin (`ref_b.png`): its reference switches from slot 2 to slot 3 mid-clip |
A case directory holds `proxy.mp4` (the condition video), `first_frame.png`, `ref_a.png` / `ref_b.png` (reference images;
`ref_slots` in `case.json` says which skeleton slot each one belongs to, `0` = unused), `slots.npz` (token coverage of
each skeleton slot), `prompt.txt` (Chinese, as in training) and `case.json` (`frames`, `steps`, `seed`, `ref_slots`). The
first frames and reference images were generated by us.
Training used the trainer from the same patched LTX-2 (`ltx-trainer`, strategy `flexible`); its configuration is
`weights/ltx25_lora/training_config.yaml`. The pre-encoded LTX training latents are not released.