Views
No views yet
1git clone https://github.com/Jimntu/StatePlay.git
2cd StatePlay
3python -m venv .venv
4source .venv/bin/activate
5pip install -U pip
6pip install -e .1hf download onepiece1999/StatePlay \
2 StatePlay.safetensors \
3 --local-dir examples/checkpoint
4
5hf download Wan-AI/Wan2.2-TI2V-5B \
6 Wan2.2_VAE.pth \
7 models_t5_umt5-xxl-enc-bf16.pth \
8 --local-dir base_model/Wan-AI/Wan2.2-TI2V-5B
9
10hf download Wan-AI/Wan2.1-T2V-1.3B \
11 --include "google/umt5-xxl/*" \
12 --local-dir base_model/Wan-AI/Wan2.1-T2V-1.3B1StatePlay/
2├── examples/checkpoint/StatePlay.safetensors
3└── base_model/Wan-AI/
4 ├── Wan2.2-TI2V-5B/
5 │ ├── Wan2.2_VAE.pth
6 │ └── models_t5_umt5-xxl-enc-bf16.pth
7 └── Wan2.1-T2V-1.3B/google/umt5-xxl/
8 └── ... tokenizer files ...1export STATEPLAY_BASE_MODEL=/absolute/path/to/base_model
2export STATEPLAY_CHECKPOINT=/absolute/path/to/StatePlay.safetensorsSTATEPLAY_BASE_MODEL must directly contain Wan-AI/.1StatePlay/
2├── stateplay/
3│ ├── pipeline.py # public inference pipeline
4│ ├── cli.py # command-line inference
5│ └── models/
6│ ├── dit.py # StatePlay visual/state DiT
7│ ├── vae.py # video VAE wrapper
8│ └── text_encoder.py # text encoder wrapper
9├── training/
10│ ├── train.py # training entry point
11│ ├── runner_with_state.py # optimization/checkpoint loop
12│ └── data/ # SF3 action, state, and prompt loading
13├── diffsynth/ # minimal Wan/StatePlay dependencies
14├── scripts/
15│ ├── inference.sh
16│ ├── run_examples.sh
17│ └── train.sh
18└── examples/
19 ├── inputs/ # eight bundled inputs
20 ├── checkpoint/ # local checkpoint
21 └── generated/ # generated videos and state predictions1export CUDA_VISIBLE_DEVICES=0
2./scripts/run_examples.sh./scripts/run_examples.sh --only 01 03examples/generated/. Each example produces an MP4 and
a _state.txt file. The model is loaded once for the entire run.1export CUDA_VISIBLE_DEVICES=0
2
3./scripts/inference.sh \
4 --image examples/inputs/01_macro_success_clip/first_frame.png \
5 --actions examples/inputs/01_macro_success_clip/actions.parquet \
6 --prompt-file examples/inputs/01_macro_success_clip/prompt.txt \
7 --output output.mp4output.mp4 and output_state.txt. Defaults are 101 frames,
30 denoising steps, text CFG 5.0, state/action CFG 1.0, and seed 2.STATEPLAY_BASE_MODEL and
STATEPLAY_CHECKPOINT, or inspect all options with:./scripts/inference.sh --help1hf download onepiece1999/StatePlay-Dataset \
2 --repo-type dataset \
3 --local-dir data/StatePlay-Dataset1hf download Wan-AI/Wan2.2-TI2V-5B \
2 diffusion_pytorch_model-00001-of-00003.safetensors \
3 diffusion_pytorch_model-00002-of-00003.safetensors \
4 diffusion_pytorch_model-00003-of-00003.safetensors \
5 --local-dir base_model/Wan-AI/Wan2.2-TI2V-5B1export STATEPLAY_BASE_MODEL="$PWD/base_model"
2export STATEPLAY_DATA_ROOT="$PWD/data/StatePlay-Dataset/SF3"
3export STATEPLAY_OUTPUT="$PWD/outputs/StatePlay"
4export CUDA_VISIBLE_DEVICES=0,1,2,3
5
6./scripts/train.shCUDA_VISIBLE_DEVICES. It trains at
480×832 with 101 frames, learning rate 5e-5, state sampling end, and saves
every 500 steps. The released model is the checkpoint at step 40,000.