dir-diffusion-h3 / README.md
johndpope's picture
DiR on MiniMax H3 from Turbo: step 100, averaged weights (research checkpoint)
4bcc097 verified
|
Raw History Blame Contribute Delete
4.79 kB
---
license: other
license_name: minimax-h3-community-license
license_link: LICENSE
base_model: MiniMaxAI/MiniMax-H3
tags:
- dir
- dmd
- few-step
- lora
- video-generation
- research
---
# DiR on MiniMax H3: 4-iteration generator from Turbo (research checkpoint)
> [!WARNING]
> **Research weights, not a finished model.** One 100-step run at 2 samples per update. It fixes Turbo's over-motion and adds more detail than the teacher has. Read "What it does and does not do" before using it.
> [!CAUTION]
> **License and territory.** Derived from MiniMax H3 under the [MiniMax H3 Community License Agreement](LICENSE) (see [`NOTICE`](NOTICE)). Use and redistribution are allowed **only outside the European Union, the United Kingdom, South Korea and the United States**.
A 4-iteration generator for the MiniMax H3 video DiT, trained with DiR: "Few-Step Generation via Data-Space Iteration" by Shanchuan Lin, Yansong Peng, Fu-Yun Wang and Haoqi Fan (ByteDance Seed), [arXiv 2610.12102](https://arxiv.org/abs/2610.12102). This is an independent port, not the authors' release, and is not affiliated with ByteDance, MiniMax or LightX2V.
Code, commands and every measurement: **[github.com/scrya-com/dir-diffusion](https://github.com/scrya-com/dir-diffusion)** (README "Video, part 4"; training recipe in [issue #4](https://github.com/scrya-com/dir-diffusion/issues/4)).
## Files
| File | What |
|---|---|
| `lora_gen.safetensors` | Rank-128 generator LoRA (musubi-tuner keys). Step 100, averaged weights (EMA 0.99). |
| `dir_head.pt` | The DiR head: previous-estimate projection and iteration embedding (a plain `state_dict`, loads with `weights_only=True`). |
| `config.json` | Training settings; the loader reads the sigmas and sizes from it. |
## What it does and does not do
Latent statistics over 8 held-out prompts × 4 seeds, 12 latent frames at 32×48 (about 512×768 px), all on one RTX 5090:
| | Motion | Detail | Size (rms) |
|---|---|---|---|
| H3, 20 steps (the teacher) | 0.25 | 0.35 | 1.08 |
| Turbo 4-step (the start point) | 0.47 | 0.43 | 1.04 |
| **This checkpoint, 4 iterations** | **0.26** | **0.45** | **1.00** |
- **Motion:** down to the teacher's level. Paired with Turbo on the same prompts and seeds: −0.212 ± 0.028.
- **Detail:** slightly above Turbo's and further from the teacher (+0.018 ± 0.005). Decoded frames are sharp but busier, framing is tighter, and one of three probe prompts gains a second person.
- **Not settled:** the live weights were still losing motion at step 100, so a longer run of the same recipe would likely go too still.
- **Scope:** trained and measured only on 12-frame, 32×48 latents with long descriptive prompts. Other sizes and lengths are untested.
![20-step H3 | Turbo 4-step | step 75 | this checkpoint](compare_p2.jpg)
## Use
```bash
git clone https://github.com/scrya-com/dir-diffusion && cd dir-diffusion
pip install -r requirements.txt # install torch for your CUDA first
hf download johndpope/dir-diffusion-h3 --local-dir runs/dir_turbo_clip
# the H3 checkpoint and paths: DIR_CHEATSHEET.md, section 0
python3 lot/yardstick_dir_h3.py --out runs/yardstick --name dir --run runs/dir_turbo_clip # latent statistics
python3 lot/probe_dir_h3.py --out runs/probe --frames 12 --max-latent-hw 32 48 --items 3 --name ref --reference
python3 lot/probe_dir_h3.py --out runs/probe --frames 12 --max-latent-hw 32 48 --items 3 --name dir --run runs/dir_turbo_clip
python3 lot/probe_dir_h3.py --out runs/probe --decode dir # mp4s and frame sheets
```
The scripts read prompts from a cache of encoded captions that you build once (cheatsheet, sections 2–3); there is no prompt-string interface yet.
## How it was trained
- **Start:** LightX2V's [Minimax-H3-Turbo](https://github.com/ModelTC/Minimax-H3-Turbo) 4-step LoRA (Apache-2.0), cut to rank 128, with Turbo's sigmas and a zero DiR head.
- **Loss:** distribution matching (DMD) against the frozen H3, with the paper's per-iteration fake model. Text prompts only; no clips or images are used as targets.
- **One change for H3:** the generator's noise level is capped at 0.9. H3 is CFG-distilled, and above that level its one-call answer is dominated by the baked guidance.
- **Scale:** 100 updates, 2 samples per update, lr 2e-5, one RTX 5090, about 2.5 hours. The paper trains at batch 256.
The exact command is in the [cheatsheet](https://github.com/scrya-com/dir-diffusion/blob/main/DIR_CHEATSHEET.md) ("Reproduce the latest run exactly"). The prompt set (801 isometric stills with captions) is not published.
## Cite the paper, not this repository
Shanchuan Lin, Yansong Peng, Fu-Yun Wang and Haoqi Fan, **Few-Step Generation via Data-Space Iteration**, [arXiv 2610.12102](https://arxiv.org/abs/2610.12102).