onepiece1999 commited on
Commit
458ab1e
·
verified ·
1 Parent(s): 17eabcb

Streamline model card and update release links

Browse files
Files changed (1) hide show
  1. README.md +120 -44
README.md CHANGED
@@ -13,53 +13,35 @@ tags:
13
  - state-aware
14
  ---
15
 
16
- # StatePlay: State-Aware Game World Models for Mechanics-Consistent Generation
17
 
18
  [**Project Page**](https://jimntu.github.io/stateplay_page/) ·
19
  [**Paper**](https://arxiv.org/abs/2607.26754) ·
20
  [**Code**](https://github.com/Jimntu/StatePlay) ·
21
- [**Dataset**](https://huggingface.co/datasets/onepiece1999/StatePlay-Dataset)
 
22
 
23
- StatePlay is a state-aware game world model for mechanics-consistent generation in *Street Fighter III*. Unlike pixel-only game world models, StatePlay jointly predicts future visual frames and explicit internal game states—including the timer, player and opponent health points, and both skill meters—conditioned on an initial frame, a text prompt, and player actions.
24
-
25
- StatePlay uses a Mixture-of-Transformers (MoT)-style architecture with specialized visual and state branches connected through bidirectional joint attention. Predicted state dynamics can therefore guide frame generation while each branch preserves its modality-specific representation. Experiments show an average normalized L1 distance below 0.06 for state prediction and an 18.6 percentage-point improvement in mechanics fidelity over the strongest stateless baseline.
26
-
27
- ## Checkpoint
28
-
29
- `StatePlay.safetensors` is the complete StatePlay DiT state dictionary trained for 40,000 steps.
30
-
31
- | Item | Value |
32
- |---|---|
33
- | Base architecture | Wan2.2 TI2V 5B with a StatePlay state branch |
34
- | Game | Street Fighter III |
35
- | Default output | 480 × 832, 101 frames at 20 FPS |
36
- | Predicted states | timer, player/opponent HP, player/opponent skill meter |
37
- | Checkpoint size | approximately 11.5 GB |
38
- | SHA256 | `aba9747fcd3f0c0a3546941253cd99ecd5dbc2c69747d647b91de84ee41f722f` |
39
-
40
- The checkpoint contains the complete DiT weights. The three Wan2.2 diffusion shards are not required for inference, but the Wan2.2 VAE and T5 encoder and the Wan2.1 UMT5 tokenizer are required.
41
 
42
  ## Installation
43
 
 
 
44
  ```bash
45
  git clone https://github.com/Jimntu/StatePlay.git
46
  cd StatePlay
47
-
48
  python -m venv .venv
49
  source .venv/bin/activate
50
  pip install -U pip
51
  pip install -e .
52
  ```
53
 
54
- Python 3.10 or newer and a CUDA GPU are required. The reference inference path uses `torch.bfloat16`.
55
-
56
- ## Download
57
-
58
- Run the following commands from the StatePlay code repository:
59
 
60
  ```bash
61
- python -m pip install -U huggingface_hub
62
-
63
  hf download onepiece1999/StatePlay \
64
  StatePlay.safetensors \
65
  --local-dir examples/checkpoint
@@ -74,7 +56,7 @@ hf download Wan-AI/Wan2.1-T2V-1.3B \
74
  --local-dir base_model/Wan-AI/Wan2.1-T2V-1.3B
75
  ```
76
 
77
- The resulting files should have this layout:
78
 
79
  ```text
80
  StatePlay/
@@ -87,12 +69,67 @@ StatePlay/
87
  └── ... tokenizer files ...
88
  ```
89
 
90
- ## Inference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
- The code repository provides eight reproducible example inputs. To generate one example:
 
 
 
 
 
 
 
93
 
94
  ```bash
95
- export STATEPLAY_BASE_MODEL=/path/to/StatePlay/base_model
96
  export CUDA_VISIBLE_DEVICES=0
97
 
98
  ./scripts/inference.sh \
@@ -102,21 +139,60 @@ export CUDA_VISIBLE_DEVICES=0
102
  --output output.mp4
103
  ```
104
 
105
- The command writes the generated video to `output.mp4` and the predicted state trajectory to `output_state.txt`. See the [code repository](https://github.com/Jimntu/StatePlay) for the Python API, input schema, additional examples, and training instructions.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
 
107
- ## Intended use and limitations
 
 
 
 
108
 
109
- This release is intended for research on state-aware game world models, action-conditioned video generation, and mechanics-consistent generation. The current model is trained and evaluated on *Street Fighter III* and should not be assumed to generalize to other games or visual domains without additional training. Generated rollouts can still contain visual, temporal, action-control, or state-prediction errors.
 
110
 
111
- Users are responsible for complying with the licenses and terms of the StatePlay code, Wan base models, dataset, game content, and other third-party assets.
 
 
 
112
 
113
- ## Citation
114
 
115
- ```bibtex
116
- @article{stateplay2026,
117
- title = {StatePlay: State-Aware Game World Models for Mechanics-Consistent Generation},
118
- author = {Lin, Zijun and Wang, Zeqing and Tan, Cheston and Wen, Bihan and Jin, Yeying},
119
- journal = {arXiv preprint arXiv:2607.26754},
120
- year = {2026}
121
- }
 
122
  ```
 
13
  - state-aware
14
  ---
15
 
16
+ # StatePlay
17
 
18
  [**Project Page**](https://jimntu.github.io/stateplay_page/) ·
19
  [**Paper**](https://arxiv.org/abs/2607.26754) ·
20
  [**Code**](https://github.com/Jimntu/StatePlay) ·
21
+ [**Dataset**](https://huggingface.co/datasets/onepiece1999/StatePlay-Dataset) ·
22
+ [**Model**](https://huggingface.co/onepiece1999/StatePlay)
23
 
24
+ StatePlay is a state- and action-conditioned world model for mechanics-consistent
25
+ generation in *Street Fighter III*. It jointly predicts video frames and five
26
+ game states: timer, both players' health, and both players' skill meters. The
27
+ released checkpoint was trained for **40,000 optimization steps**.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  ## Installation
30
 
31
+ Requirements: Python 3.10+, CUDA, and a GPU with bfloat16 support.
32
+
33
  ```bash
34
  git clone https://github.com/Jimntu/StatePlay.git
35
  cd StatePlay
 
36
  python -m venv .venv
37
  source .venv/bin/activate
38
  pip install -U pip
39
  pip install -e .
40
  ```
41
 
42
+ Download the inference weights:
 
 
 
 
43
 
44
  ```bash
 
 
45
  hf download onepiece1999/StatePlay \
46
  StatePlay.safetensors \
47
  --local-dir examples/checkpoint
 
56
  --local-dir base_model/Wan-AI/Wan2.1-T2V-1.3B
57
  ```
58
 
59
+ Expected inference layout:
60
 
61
  ```text
62
  StatePlay/
 
69
  └── ... tokenizer files ...
70
  ```
71
 
72
+ To keep weights elsewhere:
73
+
74
+ ```bash
75
+ export STATEPLAY_BASE_MODEL=/absolute/path/to/base_model
76
+ export STATEPLAY_CHECKPOINT=/absolute/path/to/StatePlay.safetensors
77
+ ```
78
+
79
+ `STATEPLAY_BASE_MODEL` must directly contain `Wan-AI/`.
80
+
81
+ ## Code architecture
82
+
83
+ StatePlay uses separate visual and state transformer branches with shared joint
84
+ attention. The visual branch predicts video latents; the state branch predicts
85
+ the five normalized game states. Both branches are conditioned on the initial
86
+ frame, text prompt, and action sequence.
87
+
88
+ ```text
89
+ StatePlay/
90
+ ├── stateplay/
91
+ │ ├── pipeline.py # public inference pipeline
92
+ │ ├── cli.py # command-line inference
93
+ │ └── models/
94
+ │ ├── dit.py # StatePlay visual/state DiT
95
+ │ ├── vae.py # video VAE wrapper
96
+ │ └── text_encoder.py # text encoder wrapper
97
+ ├── training/
98
+ │ ├── train.py # training entry point
99
+ │ ├── runner_with_state.py # optimization/checkpoint loop
100
+ │ └── data/ # SF3 action, state, and prompt loading
101
+ ├── diffsynth/ # minimal Wan/StatePlay dependencies
102
+ ├── scripts/
103
+ │ ├── inference.sh
104
+ │ ├── run_examples.sh
105
+ │ └── train.sh
106
+ └── examples/
107
+ ├── inputs/ # eight bundled inputs
108
+ ├── checkpoint/ # local checkpoint
109
+ └── generated/ # generated videos and state predictions
110
+ ```
111
+
112
+ ## Run examples
113
+
114
+ Generate all eight bundled examples:
115
+
116
+ ```bash
117
+ export CUDA_VISIBLE_DEVICES=0
118
+ ./scripts/run_examples.sh
119
+ ```
120
+
121
+ Generate selected examples:
122
 
123
+ ```bash
124
+ ./scripts/run_examples.sh --only 01 03
125
+ ```
126
+
127
+ Outputs are written to `examples/generated/`. Each example produces an MP4 and
128
+ a `_state.txt` file. The model is loaded once for the entire run.
129
+
130
+ ## Inference
131
 
132
  ```bash
 
133
  export CUDA_VISIBLE_DEVICES=0
134
 
135
  ./scripts/inference.sh \
 
139
  --output output.mp4
140
  ```
141
 
142
+ This writes `output.mp4` and `output_state.txt`. Defaults are 101 frames,
143
+ 30 denoising steps, text CFG 5.0, state/action CFG 1.0, and seed 2.
144
+
145
+ Use custom model paths through `STATEPLAY_BASE_MODEL` and
146
+ `STATEPLAY_CHECKPOINT`, or inspect all options with:
147
+
148
+ ```bash
149
+ ./scripts/inference.sh --help
150
+ ```
151
+
152
+ ## Training
153
+
154
+ Download the training dataset:
155
+
156
+ ```bash
157
+ hf download onepiece1999/StatePlay-Dataset \
158
+ --repo-type dataset \
159
+ --local-dir data/StatePlay-Dataset
160
+ ```
161
+
162
+ Download the three Wan2.2 DiT initialization shards:
163
+
164
+ ```bash
165
+ hf download Wan-AI/Wan2.2-TI2V-5B \
166
+ diffusion_pytorch_model-00001-of-00003.safetensors \
167
+ diffusion_pytorch_model-00002-of-00003.safetensors \
168
+ diffusion_pytorch_model-00003-of-00003.safetensors \
169
+ --local-dir base_model/Wan-AI/Wan2.2-TI2V-5B
170
+ ```
171
+
172
+ Run training:
173
 
174
+ ```bash
175
+ export STATEPLAY_BASE_MODEL="$PWD/base_model"
176
+ export STATEPLAY_DATA_ROOT="$PWD/data/StatePlay-Dataset/SF3"
177
+ export STATEPLAY_OUTPUT="$PWD/outputs/StatePlay"
178
+ export CUDA_VISIBLE_DEVICES=0,1,2,3
179
 
180
+ ./scripts/train.sh
181
+ ```
182
 
183
+ The script derives the process count from `CUDA_VISIBLE_DEVICES`. It trains at
184
+ 480×832 with 101 frames, learning rate `5e-5`, state sampling `end`, and saves
185
+ every 500 steps. The released model is the checkpoint at **step 40,000**; stop
186
+ training after that checkpoint is written.
187
 
188
+ For GPUs that do not need the original H200 memory reservation:
189
 
190
+ ```bash
191
+ RESERVE_CUDA_MEMORY_GB=0 ./scripts/train.sh
192
+ ```
193
+
194
+ Resume from a DiT checkpoint:
195
+
196
+ ```bash
197
+ ./scripts/train.sh --resume_from_ckpt /path/to/step-N.safetensors
198
  ```