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

Metadata

Release files for sparsevideo 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sparsevideo 0.1.0
File Size Uploaded Provenance Actions
sparsevideo-0.1.0.tar.gz 3.2 MB Without provenance Details for sparsevideo-0.1.0.tar.gz

Release files / sparsevideo-0.1.0.tar.gz

Download URL sparsevideo-0.1.0.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
0a55a81da2eecebdde412ea7c261b29d30c4f6dedee6fe1e7489ae4e801bec31
BLAKE2b-256 checksum
How to use checksums
7dcf81a4d8f7a57fe50527cb6af48b436ebe8cd80620e968461270b329220c85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Security for sparsevideo 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

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