Skip to main content

SparseVideo Logo

A one-line, plug-and-play sparse attention framework for accelerating video diffusion inference.

📦 Installation

From PyPI

pip install sparsevideo --no-build-isolation

From source

git clone https://github.com/Mutual-Luo/SparseVideo.git
cd SparseVideo
MAX_JOBS=8 pip install -e . --no-build-isolation

🚀 Quick Start

  import torch
  from diffusers import WanPipeline
  import sparsevideo

  pipe = WanPipeline.from_pretrained("Wan-AI/Wan2.1-T2V-14B-Diffusers", torch_dtype=torch.bfloat16)
  pipe.to("cuda")

+ pipe = sparsevideo.replace_attention(pipe, method="svoo")

  video = pipe("A cat playing piano", num_frames=81, num_inference_steps=50).frames[0]

⚡ Supported Sparse Attention Methods

Method Method Method
Dense (baseline) SpargeAttn [paper] Adacluster [paper]
SVG1 [paper] Radial [paper] SVOO [paper]
SVG2 [paper] STA [paper] FlashOmni [paper]
SVG-EAR [paper] DraftAttention [paper]

🧩 Supported Frameworks

Works as a drop-in, one-line replacement for both Diffusers and DiffSynth-Studio pipelines. Just call sparsevideo.replace_attention(pipe, method=...), no model modifications required.

Diffusers

Supported 34 models:

Model Model Model
Wan 2.1 Text-to-Video 1.3B Wan 2.2 Text-to-Video A14B Video-as-Prompt Wan 2.1 14B
Wan 2.1 Text-to-Video 14B Wan 2.2 Image-to-Video A14B HunyuanVideo Text-to-Video
Wan 2.1 Image-to-Video 14B Wan 2.2 Speech-to-Video 14B HunyuanVideo Image-to-Video
Wan 2.1 VACE 1.3B Wan 2.2 Animate 14B CogVideoX Text-to-Video
Wan 2.1 VACE 14B Wan 2.2-Fun A14B Control CogVideoX Image-to-Video
Wan 2.1-Fun 1.3B Control Wan 2.2-Fun A14B Control-Camera EasyAnimate V5 Text-to-Video 12B
Wan 2.1-Fun 1.3B InP SkyReels-V2 Text-to-Video 14B LTX-Video Text-to-Video
Wan 2.1-Fun V1.1 1.3B Control SkyReels-V2 Image-to-Video 14B LTX-Video Image-to-Video
Wan 2.1-Fun V1.1 1.3B Control-Camera MoVA 720P LTX-2
Wan 2.1-Fun V1.1 14B Control LongCat-Video Mochi-1
Wan 2.1-Fun V1.1 14B Control-Camera Krea Realtime Video 14B Allegro
Wan 2.1 Speed-Control 1.3B

DiffSynth-Studio

Supported 30 models:

Model Model Model
Wan 2.1 Text-to-Video 1.3B Wan 2.1-Fun V1.1 1.3B Control Wan 2.2 Animate 14B
Wan 2.1 Text-to-Video 14B Wan 2.1-Fun V1.1 1.3B Control-Camera Wan 2.2 Dancer 14B
Wan 2.1 Image-to-Video 14B 480P Wan 2.1-Fun V1.1 14B Control Wan 2.2-Fun A14B Control
Wan 2.1 Image-to-Video 14B 720P Wan 2.1-Fun V1.1 14B Control-Camera Wan 2.2-Fun A14B Control-Camera
Wan 2.1 First-Last-Frame-to-Video 14B 720P Wan 2.1 VACE 1.3B LongCat-Video
Wan 2.1 Speed-Control 1.3B Wan 2.1 VACE 14B Video-as-Prompt Wan 2.1 14B
Wan 2.1-Fun 1.3B Control Wan 2.2 Text-to-Video A14B Krea Realtime Video 14B
Wan 2.1-Fun 1.3B InP Wan 2.2 Image-to-Video A14B MoVA 720P
Wan 2.1-Fun 14B Control Wan 2.2 Text/Image-to-Video 5B LTX-2
Wan 2.1-Fun 14B InP Wan 2.2 Speech-to-Video 14B LTX-2.3

📄 License

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sparsevideo-0.1.0.tar.gz (3.2 MB view details)

Uploaded Source

File details

Details for the file sparsevideo-0.1.0.tar.gz.

File metadata

  • Download URL: sparsevideo-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for sparsevideo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0a55a81da2eecebdde412ea7c261b29d30c4f6dedee6fe1e7489ae4e801bec31
MD5 5d9d3e622cf9786c74b5012a1f3ffa5f
BLAKE2b-256 7dcf81a4d8f7a57fe50527cb6af48b436ebe8cd80620e968461270b329220c85

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page