Instructions to use YuxinJ/O2LaF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Wan2.2
How to use YuxinJ/O2LaF with Wan2.2:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
File size: 4,757 Bytes
868a23c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | ---
license: apache-2.0
base_model: Wan-AI/Wan2.2-TI2V-5B-Diffusers
pipeline_tag: image-to-video
tags:
- world-model
- latent-action
- video-generation
- wan2.2
---
# O虏LaF: One Prior, Two Dynamics
Weights for **One Prior, Two Dynamics: Repurposing Video Diffusion Transformers
for Self-Supervised Latent Action Learning** 路
[Paper](https://arxiv.org/abs/2611.26617) 路 [Project page](https://showlab.github.io/o2laf/) 路
[Code](https://github.com/showlab/o2laf)
One pretrained video diffusion transformer, Wan 2.2 TI2V-5B, serves as the prior
for both dynamics:
- **Action encoder (inverse dynamics).** Infers a 32-dimensional latent action
for every transition between latent frames of a video.
- **World model (forward dynamics).** Generates video from a first frame and a
sequence of those actions.
No action labels were used. Actions inferred from one video can be replayed from
a different first frame.
## Files
| Path | Contents | Size |
|---|---|---|
| `latent_action_model/` | the action encoder and the causal world model, trained jointly (LoRA adapters on Wan 2.2, readout head, action embedder); fp32 | 2.5 GB |
| `world_model/` | the bidirectional world model, fully fine-tuned from the causal one on the frozen action encoder; EMA weights, bf16, 3 shards | 9.4 GB |
| `action_library/` | atomic actions: `idle`, `w`, `s`, `a`, `d`, `camera_up`, `camera_down`, `camera_left`, `camera_right`, extracted from third-person videos | 16 KB |
| `model_index.json` | what each inference mode loads, and its frame count, resolution, scheduler settings and "no action" input | |
The repository holds only what was trained. The VAE, the scheduler and the base
transformer come from
[Wan-AI/Wan2.2-TI2V-5B-Diffusers](https://huggingface.co/Wan-AI/Wan2.2-TI2V-5B-Diffusers),
which is downloaded automatically. Its text encoder is not needed: the fixed
prompt's embedding ships with the `o2laf` package.
## Usage
Install the code from the [O虏LaF repository](https://github.com/showlab/o2laf), then:
```bash
o2laf-transfer --model YuxinJ/O2LaF/o2laf_dit_mixed --source-video source.mp4 --first-frame frame.png --output out.mp4
o2laf-generate --model YuxinJ/O2LaF/o2laf_dit_mixed --action w --first-frame frame.png --output out.mp4
```
```python
from o2laf import LatentActionPipeline
pipe = LatentActionPipeline.from_pretrained("YuxinJ/O2LaF/o2laf_dit_mixed", mode="bidirectional")
```
Each mode downloads only the files it needs: about 2.5 GB for `causal`, and
12 GB for `bidirectional`.
| Mode | World model | Frames | Resolution | Null action |
|---|---|---|---|---|
| `bidirectional` (default; the one the paper evaluates) | `world_model/` | 81 at 16 fps | 480脳832 | no bias |
| `causal` | `latent_action_model/` | 41 at 16 fps | 480脳832 | zero action code |
"Null action" is the input each world model was trained to read as "no action".
Classifier-free action guidance uses it as the unconditional branch, and the
code applies the right one per mode.
## Training
- **Latent action learning.** The action encoder and the causal world model were
trained jointly on 41-frame clips for 10,000 steps, with a KL bottleneck on the
actions.
- **World model training.** The action encoder was then frozen, and the
bidirectional world model was fully fine-tuned on 81-frame clips for 10,000
steps. It started from the causal world model with its LoRA merged in.
**Training data.** Clips were drawn 70/30 from MiraData and EgoDexMix, at 16 and
24 fps respectively:
| Source | Share | Contents |
|---|---|---|
| MiraData | 70% | long third-person video with large camera and scene motion |
| EgoDex | 27% | egocentric human manipulation |
| GR-1 | 2.7% | GR-1 humanoid robot manipulation |
| PH2D | 0.3% | human and humanoid manipulation, paired |
EgoDexMix is the 90/9/1 mixture of EgoDex, GR-1 and PH2D; the shares above are
its 30% of the whole. The atomic actions are averages of the encoder's actions
over clean segments of 100 labelled third-person videos.
## Limitations
- The actions are latent. Their meaning is defined by this action encoder and
does not transfer to another one. Each atomic action library records the
action space it belongs to and refuses to load into a different model.
- Generation is trained at 480脳832 with 41 (causal) or 81 (bidirectional)
frames. Longer clips extrapolate beyond the training length.
## Citation
```bibtex
@article{jiang2026o2laf,
title = {One Prior, Two Dynamics: Repurposing Video Diffusion Transformers for Self-Supervised Latent Action Learning},
author = {Jiang, Yuxin and Sun, Wenqiang and Li, Jiaqi and Gu, Yuchao and Zhang, Lvmin and Tsang, Ivor and Shou, Mike Zheng},
journal = {arXiv preprint arXiv:2611.26617},
year = {2026}
}
```
|