| title: Neural Pong | |
| emoji: 🎮 | |
| colorFrom: blue | |
| colorTo: purple | |
| sdk: docker | |
| pinned: false | |
| license: mit | |
| # Neural Pong | |
| A real-time Pong game where frames are generated by a diffusion model trained with rectified flow matching. Control the blue paddle using arrow keys or WASD to play! | |
| ## Features | |
| - **Real-time frame generation**: Uses a frame-autoregressive transformer with diffusion sampling | |
| - **Interactive gameplay**: Control the paddle with keyboard inputs | |
| - **Configurable parameters**: Adjust FPS and diffusion steps | |
| - **Low-latency streaming**: Achieves ~16 FPS with 4 diffusion steps | |
| ## How to Play | |
| 1. Wait for the model to load (you'll see a loading spinner) | |
| 2. Click "Start Stream" to begin generating frames | |
| 3. Use **Arrow Keys** or **WASD** to control the blue paddle: | |
| - **Up/W**: Move paddle up | |
| - **Down/S**: Move paddle down | |
| 4. Adjust the FPS and diffusion steps using the controls | |
| 5. Click "Stop Stream" when done | |
| ## Technical Details | |
| This demo uses a small transformer model trained with rectified flow matching to simulate Pong game frames conditioned on user inputs. The model generates 24×24 pixel frames in real-time using diffusion sampling with configurable steps. Performance targets ~16 FPS with 4 diffusion steps on GPU hardware. | |
| ## Model Architecture | |
| - Frame-autoregressive transformer | |
| - Rectified flow matching training | |
| - Caching for efficient inference | |
| - GPU-accelerated generation | |