Metadata-Version: 2.4
Name: fastvideo
Version: 0.2.0
Summary: FastVideo
Project-URL: Repository, https://github.com/hao-ai-lab/FastVideo
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: scipy>=1.14.1
Requires-Dist: six>=1.16.0
Requires-Dist: h5py>=3.12.1
Requires-Dist: requests>=2.32.2
Requires-Dist: transformers>=4.57.3
Requires-Dist: tokenizers>=0.20.1
Requires-Dist: sentencepiece>=0.2.0
Requires-Dist: timm>=1.0.11
Requires-Dist: peft>=0.15.0
Requires-Dist: diffusers>=0.33.1
Requires-Dist: torch==2.11.0
Requires-Dist: torchvision
Requires-Dist: torchaudio
Requires-Dist: accelerate==1.0.1
Requires-Dist: opencv-python>=4.10.0.84
Requires-Dist: pillow>=10.3.0
Requires-Dist: imageio>=2.36.0
Requires-Dist: imageio-ffmpeg>=0.5.1
Requires-Dist: einops
Requires-Dist: wandb>=0.21.0
Requires-Dist: loguru
Requires-Dist: test-tube>=0.7.5
Requires-Dist: tqdm
Requires-Dist: pytest
Requires-Dist: PyYAML>=6.0.1
Requires-Dist: protobuf>=5.28.3
Requires-Dist: gradio==5.32.0
Requires-Dist: moviepy>=2.0.0
Requires-Dist: flask
Requires-Dist: flask_restful
Requires-Dist: aiohttp
Requires-Dist: aiofiles
Requires-Dist: huggingface_hub
Requires-Dist: cloudpickle
Requires-Dist: omegaconf
Requires-Dist: gpustat
Requires-Dist: watch
Requires-Dist: remote-pdb
Requires-Dist: fastvideo-kernel==0.2.6
Requires-Dist: wheel
Requires-Dist: torchdata
Requires-Dist: pyarrow
Requires-Dist: datasets>=4.0.0
Requires-Dist: av
Requires-Dist: torchcodec
Requires-Dist: ray>=2.49.1
Requires-Dist: ftfy>=6.3.1
Requires-Dist: fastapi>=0.129.0
Requires-Dist: uvicorn>=0.41.0
Provides-Extra: lint
Requires-Dist: pre-commit==4.0.1; extra == "lint"
Requires-Dist: types-aiofiles; extra == "lint"
Requires-Dist: types-requests; extra == "lint"
Provides-Extra: test
Requires-Dist: av; extra == "test"
Requires-Dist: pytorch-msssim>=1.0.0; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pandas; extra == "test"
Requires-Dist: plotly; extra == "test"
Provides-Extra: eval-vbench
Requires-Dist: openai-clip; extra == "eval-vbench"
Requires-Dist: pyiqa; extra == "eval-vbench"
Requires-Dist: easydict; extra == "eval-vbench"
Provides-Extra: eval-physics-iq
Provides-Extra: eval-audio
Requires-Dist: jiwer; extra == "eval-audio"
Requires-Dist: librosa; extra == "eval-audio"
Requires-Dist: pyloudnorm; extra == "eval-audio"
Requires-Dist: hear21passt; extra == "eval-audio"
Requires-Dist: audiobox_aesthetics; extra == "eval-audio"
Requires-Dist: imagebind; extra == "eval-audio"
Requires-Dist: pytorchvideo; extra == "eval-audio"
Provides-Extra: eval-judge
Requires-Dist: google-genai; extra == "eval-judge"
Provides-Extra: eval
Requires-Dist: lpips; extra == "eval"
Requires-Dist: ptlflow; extra == "eval"
Requires-Dist: qwen-vl-utils; extra == "eval"
Requires-Dist: fastvideo[eval-vbench]; extra == "eval"
Requires-Dist: fastvideo[eval-physics-iq]; extra == "eval"
Provides-Extra: eval-fast-decode
Requires-Dist: decord; extra == "eval-fast-decode"
Provides-Extra: eval-full
Requires-Dist: fastvideo[eval]; extra == "eval-full"
Requires-Dist: fastvideo[eval-audio]; extra == "eval-full"
Requires-Dist: qwen-omni-utils; extra == "eval-full"
Provides-Extra: dev
Requires-Dist: fastvideo[lint]; extra == "dev"
Requires-Dist: fastvideo[test]; extra == "dev"
Provides-Extra: prompt-safety
Requires-Dist: fasttext; extra == "prompt-safety"
Provides-Extra: prompt-enhancer
Requires-Dist: httpx; extra == "prompt-enhancer"
Provides-Extra: streaming
Requires-Dist: fastvideo[prompt-enhancer]; extra == "streaming"
Requires-Dist: fastvideo[prompt-safety]; extra == "streaming"
Requires-Dist: websockets; extra == "streaming"
Provides-Extra: dreamverse
Requires-Dist: uvicorn[standard]>=0.41.0; extra == "dreamverse"
Requires-Dist: cerebras-cloud-sdk; extra == "dreamverse"
Requires-Dist: flash-attn-cute; extra == "dreamverse"
Requires-Dist: flashinfer-python; extra == "dreamverse"
Requires-Dist: openai>=1.40; extra == "dreamverse"
Provides-Extra: rocm
Requires-Dist: amdsmi; extra == "rocm"
Dynamic: license-file

<div align="center">
<img src=assets/logos/logo.svg width="30%"/>
</div>

<p align="center">
     | <a href="https://hao-ai-lab.github.io/FastVideo"><b>Documentation</b></a> | <a href="https://hao-ai-lab.github.io/FastVideo/inference/inference_quick_start/"><b> Quick Start</b></a> | <a href="https://github.com/hao-ai-lab/FastVideo/discussions/982"  target="_blank"><b>Weekly Dev Meeting</b></a>  | 🟣💬 <a href="https://join.slack.com/t/fastvideo/shared_invite/zt-3f4lao1uq-u~Ipx6Lt4J27AlD2y~IdLQ" target="_blank"> <b>Slack</b> </a> |  🟣💬 <a href="https://github.com/hao-ai-lab/FastVideo/discussions/1097" target="_blank"> <b> WeChat </b> </a> |
</p>

**FastVideo is a unified post-training and real-time inference framework for accelerated video generation.**

## NEWS
- `2026/03/17`: Release Live demo: [Into the Dreamverse: Vibe Directing in FastVideo](https://dreamverse.fastvideo.org/), check out the [Blog](https://haoailab.com/blogs/dreamverse/).
- `2026/03/13`: Release Live demo: [Create a 5s 1080p Video in 4.5s with FastVideo on a Single GPU](https://1080p.fastvideo.org/), check out the [Blog](https://haoailab.com/blogs/fastvideo_realtime_1080p/).
- `2025/11/19`: Release [CausalWan2.2 I2V A14B Preview](https://huggingface.co/FastVideo/CausalWan2.2-I2V-A14B-Preview-Diffusers) models, [Blog](https://hao-ai-lab.github.io/blogs/fastvideo_causalwan_preview/) and [Inference Code!](https://github.com/hao-ai-lab/FastVideo/blob/main/examples/inference/basic/basic_self_forcing_causal_wan2_2_i2v.py).
- `2025/08/04`: Release [FastWan](https://hao-ai-lab.github.io/FastVideo/distillation/dmd) models and [Sparse-Distillation](https://hao-ai-lab.github.io/blogs/fastvideo_post_training/).

### More News

- `2025/06/14`: Release finetuning and inference code for [VSA](https://arxiv.org/pdf/2505.13389).
- `2025/04/24`: [FastVideo V1](https://hao-ai-lab.github.io/blogs/fastvideo/) is released!
- `2025/02/18`: Release the inference code for [Sliding Tile Attention](https://hao-ai-lab.github.io/blogs/sta/).

## Key Features

FastVideo has the following features:

- End-to-end post-training support for bidirectional and autoregressive models:
  - Support full finetuning and LoRA finetuning for state-of-the-art open video DiTs
  - Data preprocessing pipeline for video, image, and text data
  - Distribution Matching Distillation (DMD2) stepwise distillation.
  - Sparse attention with [Video Sparse Attention](https://arxiv.org/pdf/2505.13389)
  - [Sparse distillation](https://hao-ai-lab.github.io/blogs/fastvideo_post_training/) to achieve >50x denoising speedup
  - Scalable training with FSDP2, sequence parallelism, and selective activation checkpointing.
  - Causal distillation through Self-Forcing
  - See this [page](https://hao-ai-lab.github.io/FastVideo/training/overview/) for full list of supported models and recipes.
- State-of-the-art performance optimizations for inference
  - Sequence Parallelism for distributed inference
  - Multiple state-of-the-art attention backends
  - User-friendly CLI and Python API
  - See this [page](https://hao-ai-lab.github.io/FastVideo/inference/optimizations/) for full list of supported optimizations.
- Diverse hardware and OS support
  - Support H100, A100, 4090
  - Support Linux, Windows, MacOS
  - See this [page](https://hao-ai-lab.github.io/FastVideo/inference/support_matrix/) for full list of supported models, hardware assumptions, and optimization compatibility.
- Realtime video generation & editing
  - [Dreamverse](apps/dreamverse/README.md): stream and "vibe direct" video in realtime ([live demo](https://dreamverse.fastvideo.org/)), deployable on local GPU, a self-hosted B200 server, Docker, or serverless Modal

## Getting Started

We recommend using [uv](https://docs.astral.sh/uv/) to create a clean environment. If you previously used Conda, switching to uv generally gives faster and more stable installs.

```bash
# Create and activate a new uv environment
uv venv --python 3.12 --seed
source .venv/bin/activate

# Install FastVideo
uv pip install fastvideo
```

Please see our [docs](https://hao-ai-lab.github.io/FastVideo/getting_started/installation/) for more detailed installation instructions.

## Sparse Distillation

For our sparse distillation techniques, please see our [distillation docs](https://hao-ai-lab.github.io/FastVideo/distillation/dmd/) and check out our [blog](https://hao-ai-lab.github.io/blogs/fastvideo_post_training/).

See below for recipes and datasets:

| Model                                                                                 | Sparse Distillation                                                                                             | Dataset                                                                                                  |
| ------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| [FastWan2.1-T2V-1.3B](https://huggingface.co/FastVideo/FastWan2.1-T2V-1.3B-Diffusers) | [Recipe](https://github.com/hao-ai-lab/FastVideo/tree/main/examples/distill/Wan2.1-T2V/Wan-Syn-Data-480P)       | [FastVideo Synthetic Wan2.1 480P](https://huggingface.co/datasets/FastVideo/Wan-Syn_77x448x832_600k)     |
| [FastWan2.2-TI2V-5B](https://huggingface.co/FastVideo/FastWan2.2-TI2V-5B-Diffusers)   | [Recipe](https://github.com/hao-ai-lab/FastVideo/tree/main/examples/distill/Wan2.2-TI2V-5B-Diffusers/Data-free) | [FastVideo Synthetic Wan2.2 720P](https://huggingface.co/datasets/FastVideo/Wan2.2-Syn-121x704x1280_32k) |

## Dreamverse — Realtime Video Generation & Editing

[Dreamverse](apps/dreamverse/README.md) is FastVideo's realtime video generation
and editing platform — "vibe directing" a video as it streams. It lives in the
monorepo under [`apps/dreamverse/`](apps/dreamverse/) and ships its own backend
(`dreamverse-server`) plus a web UI.

Try the [live demo](https://dreamverse.fastvideo.org/), read the
[blog](https://haoailab.com/blogs/dreamverse/), or run it yourself. Dreamverse
deploys on a local GPU, a self-hosted B200 server over SSH, Docker, or
serverless [Modal](apps/dreamverse/scripts/modal/README.md) — see the
[Dreamverse README](apps/dreamverse/README.md).

## Inference

### Generating Your First Video

Here's a minimal example to generate a video using the default settings. Make sure VSA kernels are [installed](https://hao-ai-lab.github.io/FastVideo/attention/vsa/#installation). Create a file called `example.py` with the following code:

```python
import os
from fastvideo import VideoGenerator

def main():
    os.environ["FASTVIDEO_ATTENTION_BACKEND"] = "VIDEO_SPARSE_ATTN"

    # Create a video generator with a pre-trained model
    generator = VideoGenerator.from_pretrained(
        "FastVideo/FastWan2.1-T2V-1.3B-Diffusers",
        num_gpus=1,  # Adjust based on your hardware
    )

    # Define a prompt for your video
    prompt = "A curious raccoon peers through a vibrant field of yellow sunflowers, its eyes wide with interest."

    # Generate the video
    video = generator.generate_video(
        prompt,
        output_path="my_videos/",  # Controls where videos are saved
        save_video=True
    )

if __name__ == '__main__':
    main()
```

Run the script with:

```bash
python example.py
```

For a more detailed guide, please see our [inference quick start](https://hao-ai-lab.github.io/FastVideo/inference/inference_quick_start/).

## More Guides

- [Design Overview](https://hao-ai-lab.github.io/FastVideo/design/overview/)
- [Distillation Guide](https://hao-ai-lab.github.io/FastVideo/distillation/dmd/)
- [Contribution Guide](https://hao-ai-lab.github.io/FastVideo/contributing/overview/)

## Awesome work using FastVideo or our research projects

- [SGLang](https://github.com/sgl-project/sglang/tree/main/python/sglang/multimodal_gen): SGLang's diffusion inference functionality is based on a fork of FastVideo on Sept. 24, 2025.
- [DanceGRPO](https://github.com/XueZeyue/DanceGRPO): A unified framework to adapt Group Relative Policy Optimization (GRPO) to visual generation paradigms. Code based on FastVideo.
- [SRPO](https://github.com/Tencent-Hunyuan/SRPO): A method to directly align the full diffusion trajectory with fine-grained human preference. Code based on FastVideo.
- [DCM](https://github.com/Vchitect/DCM): Dual-expert consistency model for efficient and high-quality video generation. Code based on FastVideo.
- [HY-WorldPlay](https://github.com/Tencent-Hunyuan/HY-WorldPlay): An action-conditioned world model model trained using FastVideo framework.
- [Hunyuan Video 1.5](https://github.com/Tencent-Hunyuan/HunyuanVideo-1.5): A leading lightweight video generation model, where they proposed SSTA based on Sliding Tile Attention.
- [Kandinsky-5.0](https://github.com/kandinskylab/kandinsky-5): A family of diffusion models for video & image generation, where their NABLA attention includes a Sliding Tile Attention branch.
- [LongCat Video](https://github.com/meituan-longcat/LongCat-Video): A foundational video generation model with 13.6B parameters with block-sparse attention similar to Video Sparse Attention.

## 🤝 Contributing

We welcome all contributions. Please check out our guide [here](https://hao-ai-lab.github.io/FastVideo/contributing/overview/).
See details in [development roadmap](https://github.com/hao-ai-lab/FastVideo/issues/899).

## Acknowledgement

We learned the design and reused code from the following projects: [Wan-Video](https://github.com/Wan-Video), [ThunderKittens](https://github.com/HazyResearch/ThunderKittens), [DMD2](https://github.com/tianweiy/DMD2), [diffusers](https://github.com/huggingface/diffusers), [xDiT](https://github.com/xdit-project/xDiT), [vLLM](https://github.com/vllm-project/vllm), [SGLang](https://github.com/sgl-project/sglang). We thank [MBZUAI](https://ifm.mbzuai.ac.ae/), [Anyscale](https://www.anyscale.com/), and [GMI Cloud](https://www.gmicloud.ai/) for their support throughout this project.

## Citation

If you find FastVideo useful, please consider citing our research work:

```bibtex
@article{zhang2025vsa,
  title={Vsa: Faster video diffusion with trainable sparse attention},
  author={Zhang, Peiyuan and Chen, Yongqi and Huang, Haofeng and Lin, Will and Liu, Zhengzhong and Stoica, Ion and Xing, Eric and Zhang, Hao},
  journal={arXiv preprint arXiv:2505.13389},
  year={2025}
}

@article{zhang2025fast,
  title={Fast video generation with sliding tile attention},
  author={Zhang, Peiyuan and Chen, Yongqi and Su, Runlong and Ding, Hangliang and Stoica, Ion and Liu, Zhengzhong and Zhang, Hao},
  journal={arXiv preprint arXiv:2502.04507},
  year={2025}
}
```
