Instructions to use Lightricks/LTX-Video with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Lightricks/LTX-Video with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image, export_to_video # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Lightricks/LTX-Video", dtype=torch.bfloat16, device_map="cuda") pipe.to("cuda") prompt = "A man with short gray hair plays a red electric guitar." image = load_image( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png" ) output = pipe(image=image, prompt=prompt).frames[0] export_to_video(output, "output.mp4") - Notebooks
- Google Colab
- Kaggle
LTX-Video 2B running 100% client-side in WebGPU (C# / WebAssembly implementation)
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.
π