---
base_model: Wan-AI/Wan2.2-TI2V-5B
datasets:
- 15y6u87/MaLiang-Data
language:
- en
library_name: diffsynth
license: other
license_name: research-only
pipeline_tag: image-to-video
tags:
- world-model
- game
- video-generation
- semantic-map
- real-time
---
# MaLiang: Painting Playable Game Worlds from Numbers
[Zhiyang Deng](https://teawhite.cn/)
1,2,\*, [Shushan Xu](https://github.com/sylvana20)
1,3,\*, [Yeying Jin](https://github.com/jinyeying)
1,2,♢
1Tencent,
2National University of Singapore,
3Nanyang Technological University
\*Equal contribution ·
♢Corresponding author and project leader
[](https://huggingface.co/papers/2611.35782)
[](https://sylvana20.github.io/maliang/)
[](https://github.com/YeyingLab/MaLiang)
[](https://huggingface.co/datasets/15y6u87/MaLiang-Data)
[](#licence)

**A game hands a video model one integer per pixel, and the model paints the world, live.**
This repository contains the checkpoints presented in [MaLiang: Painting Playable Game Worlds from Numbers](https://huggingface.co/papers/2611.35782).
## Highlights
- **Numerical proxy** — the game rasterises its state (terrain, buildings, vegetation, the player's and the boss's body parts, attack effects) into one `uint8` class id per pixel. No render pass and no visual encoder.
- **Native numerical conditioning** — a 9.4M-parameter class-pooling encoder turns each 4×4 block into class shares that are added to the patch embedding of Wan2.2-TI2V-5B.
- **Real time** — a three-stage distillation (teacher forcing → consistency distillation → DMD) gives a causal four-step student that streams at 22 frames per second on one GPU.
- **Numerical canvas** — anything a game rule writes into the map is painted in the next step, and one map can be replayed from any first frame to give a new world.
## What is here
| Repository | Content | Size |
|---|---|---:|
| [`15y6u87/MaLiang`](https://huggingface.co/15y6u87/MaLiang) (this repo) | the five checkpoints of the paper and `models.sha256` | 5 × 10 GB |
| [`15y6u87/MaLiang-Data`](https://huggingface.co/datasets/15y6u87/MaLiang-Data) | the raw game recordings the model is trained on: RGB, integer class map, whitebox, condition image, actions and per-frame metadata; 256 runs, 1,228,800 frames, 21.3 h | 482 GB |
| [`YeyingLab/MaLiang`](https://github.com/YeyingLab/MaLiang) | training, distillation, inference and evaluation code | |
## Checkpoints
All checkpoints are bf16 safetensors, `vocab=parts_fx`, 832×480.
| File | Role | Used by |
|---|---|---|
| `fxcond_v1_stage3_ema_step500.safetensors` | **Deployed causal student**, 4 steps (stage-3 DMD, EMA, step 500); the real-time model of the paper | `gcdistill/eval_rollout.py`, `sample_user.py` |
| `sft_fxcond_v1_step-10667.safetensors` | Bidirectional teacher, 10,667 SFT steps; the starting point and the DMD teacher of the distillation | `sample.py`, distillation stages 1 and 3 |
| `abl_color_vae_step-5000.safetensors` | Interface ablation ①: colour-coded video encoded by the Wan VAE | `experiments/abl/` |
| `abl_color_light_step-5000.safetensors` | Interface ablation ②: colour-coded video through a light encoder of the same cost as ours | `experiments/abl/` |
| `abl_v3_ids_step-5000.safetensors` | Interface ablation ③/④: integer map, step-5000 snapshot of the teacher run (same budget as ① and ②) | `experiments/abl/` |
### Integer map vocabulary (`parts_fx`)
Seven static scene classes (sky/background, terrain, paving, architecture, rock, vegetation, prop), the body
parts of the player and of the boss, four boss attack-effect classes (light and heavy attacks of two bosses), and
`255` for unknown. The exact table is in the code (`code/gc25d/model.py`).
## Quick start
```bash
pip install -U huggingface_hub
hf download 15y6u87/MaLiang --local-dir models
cd models && sha256sum -c models.sha256 && cd ..
```
Install the code as described in the [GitHub README](https://github.com/YeyingLab/MaLiang#installation), download
`Wan-AI/Wan2.2-TI2V-5B` into `models/Wan2.2-TI2V-5B`, then render your own first frame and integer maps with the
real-time student:
```bash
python code/gc25d/sample_user.py \
--ckpt models/fxcond_v1_stage3_ema_step500.safetensors \
--first_frame first.png --ids ids.npz --prompts prompts.json \
--out outputs/user_demo --name demo --steps 50
```
`ids.npz` holds a `uint8` array of shape `[81, 480, 832]` in the `parts_fx` vocabulary; `--export_clip