LTX-Video 2B running 100% client-side in WebGPU (C# / WebAssembly implementation)

#123
by LostBeard - opened

Hey everyone! πŸ‘‹

I wanted to share an implementation of LTX-Video running entirely client-side in the browser via WebGPU, built using our open-source C# AI engine, SpawnDev.ILGPU.ML.

No native inference binaries, no ONNX Runtime, no PyTorch backend, and zero server-side GPU processing. The 2B model weights stream directly into WebGPU compute buffers, and everything runs locally inside the user's browser tab.

πŸŽ₯ Live Demo

You can test it right now in your browser (requires WebGPU support, e.g., Chrome/Edge):
πŸ‘‰ https://lostbeard.github.io/SpawnDev.ILGPU.ML/video

⚑ Supported Features in the WebGPU Studio:

  • Text-to-Video & Image-to-Video: Generate clips from prompts or animate uploaded pictures / webcam snapshots.
  • Keyframe Morphing: Smooth transitions between start and end keyframes.
  • Two-Pass Recipe (0.9.8 Distilled): 7-step denoising pass + 2x latent upscaler pipeline.
  • Clip Extension: Extend previously generated clips directly in-browser.
  • Live Step Previews: Real-Time visual feedback of video latent frames forming as they are denoised step-by-step.
  • Story Mode: Combines local LLM prompt generation (Qwen3) with multi-shot scene sequencing and integrated local TTS audio generation.

πŸ“Š Performance

On a desktop GPU (e.g., RTX 4070) via WebGPU in Chrome:

  • 704x480, 97 frames: 59 seconds initial generation (30 seconds with model retained in GPU memory).

βš™οΈ How it works

The entire pipeline is compiled from C# kernels down to WGSL via SpawnDev.ILGPU. Large weight files (FP8/INT4 quantized variants) stream directly via ranged HTTP into browser storage (OPFS) and load straight to WebGPU buffers without touching the .NET heap.

The code is fully open-source (MIT licensed) on GitHub:
πŸ™ GitHub: https://github.com/LostBeard/SpawnDev.ILGPU.ML

Huge thanks to the Lightricks team for releasing LTX-Video! Feedback and ideas on WebGPU optimization for video diffusion are always welcome.

πŸ––

Sign up or log in to comment