8000 GitHub - xxxyxun/BiWM: The first open-source minimalist training framework for bidirectional autoregressive video world models. · GitHub
[go: up one dir, main page]

Skip to content
8000
xxxyxunPublic
forked from LynnReal-AI/BiWM

About

The first open-source minimalist training framework for bidirectional autoregressive video world models.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

33 Commits

Folders and files

Repository files navigation

🎮 BiWM: Bidirectional Autoregressive Video World Models

中文

The first open-source training framework for bidirectional autoregressive video world models.

arXiv HF Paper WeChat License

BiWM turns a pretrained bidirectional video diffusion model into an action-controllable, autoregressive world model in two training stages:

  1. Camera-control fine-tuning with 81 discrete camera actions.
  2. Few-step DMD distillation for chunk-by-chunk autoregressive generation.

Unlike causal-attention pipelines, BiWM keeps full bidirectional attention inside each current chunk and its history. It supports t2v, i2v, and v2v conditioning in one model.

Demo

demo_web.1.mp4

Supported backbones

2026-11-10: MiniMax-H3 support added. The first H3 release provides camera-only ProPE flow-matching training with LoRA/full fine-tuning. H3 uses a three-stage roadmap: camera training → FramePack v2v LoRA adaptation → bidirectional AR DMD. 2026-11-11: H3 Stage 2 FramePack v2v added. The implementation and configurations completed 1000 additional updates on 8×H200, with complete Live1010 checkpoints and eight native 158-frame validation cases. Geometry/viewpoint drift remains; this is functional training validation, not convergence. The separate H3 Stage 3 DMD implementation includes native teacher preflight, full-critic self-forcing training and complete-state checkpoints. The latest native 8×H200 continuation completed 30 new G / 150 new C updates to G50/C255 from the complete G20/C105 state, without extra warmup. G21/G35/G50 each produced eight native 158-frame cases: all 96 MP4s passed independent integrity checks. G50 models, both FP32 Adams, RNG and cursors restored bitwise on all eight GPUs. Sampled comparison with G20 shows better late content/detail in some cases, including a retained game character, but identity/action, camera and layout errors remain. This is bounded training validation, not a converged model-quality release. See the H3 guide and validation scope.

Backbone Stage 1 Stage 2 DMD
Wan2.1-1.3B ✅ ✅
Wan2.2-TI2V-5B ✅ ✅
HunyuanVideo-1.5-8B ✅ cam-text + discrete action ✅
LTX-Video 2.3-22B ✅ ✅
MiniMax-H3-33B ✅ ProPE camera FM; FramePack v2v Experimental H3 Stage 3: G50/C255, native media and full-state restore verified

Setup

Use separate environments for Wan and HY15/LTX23.

Wan2.1 / Wan2.2

conda create -n biwm-wan python=3.10 -y
conda activate biwm-wan
pip install torch==2.5.1 torchvision==0.20.1 --index-url https://download.pytorch.org/whl/cu124
pip install transformers==4.44.2 diffusers==0.31.0 accelerate==1.13.0 \
  tokenizers==0.19.1 numpy==1.26.4 peft==0.19.1 torchao==0.17.0 \
  easydict decord einops safetensors imageio imageio-ffmpeg opencv-python

HunyuanVideo-1.5 / LTX-2.3

conda create -n biwm-hy15 python=3.10 -y
conda activate biwm-hy15
pip install torch==2.9.1 torchvision==0.24.1 --index-url https://download.pytorch.org/whl/cu128
pip install transformers==4.56.0 diffusers==0.35.0 torchao==0.15.0 \
  decord einops safetensors imageio imageio-ffmpeg opencv-python

HY15 uses Qwen2.5-VL; LTX23 uses Gemma-3. See hunyuan/ENV_SETUP.md for HY15-specific setup and troubleshooting.

Data

Download the released dataset:

hf download shaohao011/BiWM --repo-type dataset --local-dir dataset
tar -xf dataset/videos_syn.tar -C dataset
tar -xf dataset/videos_real.tar -C dataset

Expected layout:

dataset/
├── videos/                 # synthetic clips
├── videos_syn.json
├── video_real/             # real-game clips
└── videos_real.json

Each JSON record contains a scene-only caption and action_frames. Camera action action_label = translation * 9 + rotation, producing 81 combined actions.

Training

All scripts run from any working directory, resolve the repository root automatically, and allow paths to be overridden through environment variables.

Wan2.2

bash scripts/wan22/stage1_pretrain.sh
STAGE1_DIR=./logs/wan22/stage1 bash scripts/wan22/stage2_dmd.sh

Wan2.1 uses the corresponding scripts under scripts/wan21/.

HunyuanVideo-1.5 discrete actions

Place the base weights under ckpts/HunyuanVideo-1.5, then run:

bash scripts/hy15/stage1_action.sh
STAGE1_DIR=./logs/hy15/stage1_action bash scripts/hy15/stage2_dmd_action.sh

The action path injects per-latent-frame discrete actions into AdaLN while keeping captions free of camera descriptions.

LTX-Video 2.3

export LTX2_CKPT=./ckpts/LTX-Video-2.3/ltx-2.3-22b-dev.safetensors
export GEMMA_PATH=./ckpts/LTX-Video-2.3/google/gemma-3-12b-it-qat-q4_0-unquantized
bash scripts/ltx23/stage1.sh
STAGE1_DIR=./logs/ltx23/stage1 bash scripts/ltx23/stage2_dmd.sh

Common overrides: BIWM_VIDEO_DIR, BIWM_CAPTION_JSON, OUTPUT_DIR, PYTHON_BIN, MAX_TRAIN_STEPS, and CHECKPOINTING_STEPS.

MiniMax-H3

Use the separate H3 environment and preencoded camera data:

H3_MODEL_PATH=/path/to/H3 H3_MANIFEST=/path/to/manifest.jsonl \
OUTPUT_DIR=/path/to/new/run NPROC_PER_NODE=8 bash scripts/h3/stage1.sh

The H3 path keeps ProPE camera injection and a single flow-matching MSE loss. It has no gesture/HAND conditioning or auxiliary perceptual losses. For the separate H3 Stage 2, merge the official SolarWM camera LoRA and train a fresh LoRA plus FramePack compressor using the FramePack guide.

Inference

Wan distilled-model inference:

python pipelines/wan/infer_stage2.py \
  --generator_ckpt ./logs/wan22/stage2/checkpoint-XXXX \
  --wan_base ./ckpts/Wan2.2-TI2V-5B \
  --mode t2v \
  --prompt "A character explores a forest" \
  --action_frames 'w-8, right-12, s-6' \
  --output ./outputs/dmd_infer.mp4

Repository layout

Path Purpose
pipelines/wan/ Wan Stage 1, DMD, inference, and compression
pipelines/hy15/ HY15 Stage 1 and DMD
pipelines/ltx23/ LTX23 Stage 1 and DMD
h3/, pipelines/h3/ H3 camera FM, SolarWM merge/data preparation, FramePack v2v, and autoregressive DMD
pipelines/common/ Shared DMD, optimizer, and control code
wan/, hunyuan/, ltx23/ Backbone implementations
scripts/ Public training and inference entrypoints

Citation

@article{rui2026biwm,
  title={BiWM: Advancing Open-Source Interactive Video World Models with Bidirectional Autoregression},
  author={Rui, Shaohao and Mao, Xiaofeng and Zhang, Zhanyu and Lin, Peijia and Zhu, Yansong and Zhang, Yibo and Wan, Haibin and Zhao, Zhangrui and Ma, Weijie},
  journal={arXiv preprint arXiv:2606.10135},
  year={2026}
}

Acknowledgements

Built upon FastVideo, minWM, Wan, HunyuanVideo-1.5, and LTX-Video.

License

Released under the Apache License 2.0.

About

The first open-source minimalist training framework for bidirectional autoregressive video world models.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0