CoolFace
Apppublic

jbilcke-hf/NON_WORKING_matrix_game

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

<!-- markdownlint-disable first-line-h1 --> <!-- markdownlint-disable html --> <!-- markdownlint-disable no-duplicate-header -->

Matrix-Game: Interactive World Foundation Model

<font size=7><div align='center' > [๐Ÿค— Huggingface] [๐Ÿ“– Technical Report] [๐Ÿš€ Project Website] </div></font>

<div align="center"> <img src="assets/videos/demo.gif" alt="teaser" /> </div>

๐Ÿ“ Overview

Matrix-Game is a 17B-parameter interactive world foundation model for controllable game world generation.

โœจ Key Features

  • โ€”๐ŸŽฏ Feature 1: Interactive Generation. A diffusion-based image-to-world model that generates high-quality videos conditioned on keyboard and mouse inputs, enabling fine-grained control and dynamic scene evolution.
  • โ€”๐Ÿš€ Feature 2: GameWorld Score. A comprehensive benchmark for evaluating Minecraft world models across four key dimensions, including visual quality, temporal quality, action controllability, and physical rule understanding.
  • โ€”๐Ÿ’ก Feature 3: Matrix-Game Dataset A large-scale Minecraft dataset with fine-grained action annotations, supporting scalable training for interactive and physically grounded world modeling.

๐Ÿ”ฅ Latest Updates

  • โ€”[2025-05] ๐ŸŽ‰ Initial release of Matrix-Game Model

๐Ÿš€ Performance Comparison

GameWorld Score Benchmark Comparison

ModelImage Quality โ†‘Aesthetic Quality โ†‘Temporal Cons. โ†‘Motion Smooth. โ†‘Keyboard Acc. โ†‘Mouse Acc. โ†‘3D Cons. โ†‘
Oasis0.650.480.940.980.770.560.56
MineWorld0.690.470.950.980.860.640.51
Ours0.720.490.970.980.950.950.76

Metric Descriptions:

  • โ€”Image Quality / Aesthetic: Visual fidelity and perceptual appeal of generated frames
  • โ€”Temporal Consistency / Motion Smoothness: Temporal coherence and smoothness between frames
  • โ€”Keyboard Accuracy / Mouse Accuracy: Accuracy in following user control signals
  • โ€”3D Consistency: Geometric stability and physical plausibility over time

Please check our GameWorld benchmark for detailed implementation.

Human Evaluation

[image]

Double-blind human evaluation by two independent groups across four key dimensions: Overall Quality, Controllability, Visual Quality, and Temporal Consistency. Scores represent the percentage of pairwise comparisons in which each method was preferred. Matrix-Game consistently outperforms prior models across all metrics and both groups.

๐Ÿš€ Quick Start

# clone the repository:
git clone https://github.com/SkyworkAI/Matrix-Game.git
cd Matrix-Game

# install dependencies:
pip install -r requirements.txt

# install apex and FlashAttention-3
# Our project also depends on [apex](https://github.com/NVIDIA/apex) and [FlashAttention-3](https://github.com/Dao-AILab/flash-attention)

# Run batch inference to generate videos
bash run_inference.sh

# Run interactive websocket server
python server.py --model_root ./models/matrixgame

Interactive WebSocket Server

We've implemented a real-time interactive WebSocket server that uses the Matrix-Game model to generate game frames based on keyboard and mouse inputs:

Features:

  • โ€”Real-time Generation: Frames are generated on-the-fly based on user inputs
  • โ€”Keyboard & Mouse Control: Move through the virtual world using WASD keys and mouse movements
  • โ€”Multiple Scenes: Choose from different environments (forest, desert, beach, hills, etc.)
  • โ€”Fallback Mode: Automatically falls back to demo mode when GPU resources are unavailable

Usage:

bash
# Basic startup
python server.py

# With custom model paths
python server.py --model_root ./models/matrixgame --port 8080

# With individual model component paths
python server.py --dit_path ./custom/dit --vae_path ./custom/vae --textenc_path ./custom/textenc

Connection:

  • โ€”WebSocket endpoint: ws://localhost:8080/ws
  • โ€”Web client: http://localhost:8080/

System Requirements:

  • โ€”NVIDIA GPU with CUDA support
  • โ€”24GB+ VRAM recommended for smooth frame generation

๐Ÿ”ง Hardware Requirements

  • โ€”GPU:
  • โ€”NVIDIA A100/H100
  • โ€”VRAM:
  • โ€”Requires โ‰ฅ80GB of GPU memory for a single 65-frame video inference.

โญ Acknowledgements

We would like to express our gratitude to:

  • โ€”Diffusers for their excellent diffusion model framework
  • โ€”HunyuanVideo for their strong base model
  • โ€”MineDojo for their Minecraft video dataset
  • โ€”MineRL for their excellent gym framework
  • โ€”Video-Pre-Training for their accurate Inverse Dynamics Model
  • โ€”GameFactory for their idea of action control module

We are grateful to the broader research community for their open exploration and contributions to the field of interactive world generation.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ“Ž Citation

If you find this project useful, please cite our paper:

bibtex
@article{zhang2025matrixgame,
  title     = {Matrix-Game: Interactive World Foundation Model},
  author    = {Yifan Zhang and Chunli Peng and Boyang Wang and Puyi Wang and Qingcheng Zhu and Zedong Gao and Eric Li and Yang Liu and Yahui Zhou},
  journal   = {arXiv},
  year      = {2025}
}