Update README.md
Browse files
README.md
CHANGED
|
@@ -83,6 +83,103 @@ where \(c\) represents the text conditioning.
|
|
| 83 |
|
| 84 |
During generation, the model starts from Gaussian noise and integrates the predicted velocity field in the reverse direction.
|
| 85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
## Text conditioning
|
| 87 |
|
| 88 |
Text embeddings are supplied by the external `text_emb.py` module.
|
|
|
|
| 83 |
|
| 84 |
During generation, the model starts from Gaussian noise and integrates the predicted velocity field in the reverse direction.
|
| 85 |
|
| 86 |
+
## Quick Start
|
| 87 |
+
|
| 88 |
+
### 1. Prepare the environment
|
| 89 |
+
|
| 90 |
+
Run the project on a Google Cloud TPU VM with a compatible PyTorch/XLA installation.
|
| 91 |
+
|
| 92 |
+
Install the required Python dependencies:
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
pip install numpy pillow av lpips huggingface_hub
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
PyTorch and PyTorch/XLA must be installed using versions compatible with the TPU runtime. Do not install arbitrary versions independently.
|
| 99 |
+
|
| 100 |
+
Verify the environment:
|
| 101 |
+
|
| 102 |
+
```bash
|
| 103 |
+
python -c "import torch, torch_xla, numpy, av, lpips; print('Environment OK')"
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
### 2. Prepare the files
|
| 107 |
+
|
| 108 |
+
The project directory should contain:
|
| 109 |
+
|
| 110 |
+
```text
|
| 111 |
+
WorldDiT/
|
| 112 |
+
wm.py
|
| 113 |
+
train.py
|
| 114 |
+
train_1b.py
|
| 115 |
+
vae.py
|
| 116 |
+
text_emb.py
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
The required data and VAE checkpoint should be available at:
|
| 120 |
+
|
| 121 |
+
```text
|
| 122 |
+
~/wm_data/
|
| 123 |
+
latents.npy
|
| 124 |
+
txt_emb.npy
|
| 125 |
+
txt_mask.npy
|
| 126 |
+
txt_idx.npy
|
| 127 |
+
|
| 128 |
+
~/vae_run/
|
| 129 |
+
last.pt
|
| 130 |
+
|
| 131 |
+
~/wm_run/
|
| 132 |
+
lat_stats.npz
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
The dataset must be prepared before training. See the Dataset Format section for the expected array shapes.
|
| 136 |
+
|
| 137 |
+
### 3. Start Base training
|
| 138 |
+
|
| 139 |
+
From the project directory:
|
| 140 |
+
|
| 141 |
+
```bash
|
| 142 |
+
cd ~/WorldDiT
|
| 143 |
+
MAX_MIN=240 python train.py
|
| 144 |
+
```
|
| 145 |
+
|
| 146 |
+
This starts the approximately 159M-parameter configuration.
|
| 147 |
+
|
| 148 |
+
The model checkpoint is saved to:
|
| 149 |
+
|
| 150 |
+
```text
|
| 151 |
+
~/wm_run/wm.pt
|
| 152 |
+
```
|
| 153 |
+
|
| 154 |
+
### 4. Start Large training
|
| 155 |
+
|
| 156 |
+
To train the approximately 1.056B-parameter configuration:
|
| 157 |
+
|
| 158 |
+
```bash
|
| 159 |
+
cd ~/WorldDiT
|
| 160 |
+
MAX_MIN=300 python train_1b.py
|
| 161 |
+
```
|
| 162 |
+
|
| 163 |
+
The checkpoint is saved to:
|
| 164 |
+
|
| 165 |
+
```text
|
| 166 |
+
~/wm1b_run/wm.pt
|
| 167 |
+
```
|
| 168 |
+
|
| 169 |
+
### 5. Monitor training
|
| 170 |
+
|
| 171 |
+
Training logs are written to:
|
| 172 |
+
|
| 173 |
+
```text
|
| 174 |
+
log.txt
|
| 175 |
+
```
|
| 176 |
+
|
| 177 |
+
The scripts periodically save checkpoints and generate test videos using the EMA model. Generated MP4 files are saved in the corresponding run directory.
|
| 178 |
+
|
| 179 |
+
### Important
|
| 180 |
+
|
| 181 |
+
The current implementation provides TPU training and periodic test generation. It does not yet include a standalone inference script for loading a pretrained checkpoint and generating a video from an arbitrary prompt without starting the training script.
|
| 182 |
+
|
| 183 |
## Text conditioning
|
| 184 |
|
| 185 |
Text embeddings are supplied by the external `text_emb.py` module.
|