FastVideo

hao-ai-labApache-2.0活跃维护

统一视频生成推理与后训练框架,支持扩散模型加速、蒸馏和微调,帮你在有限算力下更快跑出视频。

A unified inference and post-training framework for accelerated video generation.

v0.2.0发布于 2026-06-04 21:24 UTC4,802star +10 / 7 天520fork同步于 2026-11-10 11:37 UTC

怎么上手

由 README 提炼,执行前请确认
uv venv --python 3.12 --seed
source .venv/bin/activate
UV_TORCH_BACKEND=cu126 uv pip install fastvideo
硬件要求按 README 说明

README 称支持 H100、A100、4090,以及 RTX 5090、RTX PRO 6000、DGX Spark 和 Apple Silicon(MLX);FastH3 Trim 模型最低可在 8 GB 显存运行;支持 Linux、Windows、macOS。

8G 显存可跑支持 Apple Silicon需要 CUDA支持 ROCm / AMD
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

统一视频生成后训练与实时推理框架,用稀疏注意力和蒸馏把扩散视频模型跑快

统一视频生成推理与后训练框架,支持扩散模型加速、蒸馏和微调,帮你在有限算力下更快跑出视频。

核心能力

  • 支持全量与 LoRA 微调开源视频 DiT 模型
  • 用 DMD2 做逐步蒸馏,稀疏蒸馏实现超 50 倍去噪加速
  • 集成 Video Sparse Attention 可训练稀疏注意力
  • 用 FSDP2、序列并行和选择性激活检查点扩展训练
  • 提供 CLI 与 Python API,支持分布式推理序列并行

容易踩的坑

默认示例需先单独安装 VSA 注意力内核,否则 VIDEO_SPARSE_ATTN 后端不可用;模型权重需从 Hugging Face 另行下载;在 Colab/Kaggle 这类约 16GB 主机内存的机器上应保持 num_gpus=1,多卡易 OOM。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v0.2.0
  1. v0.2.0Release 0.2.0最新正式版2026-06-04 · 2026-06-04 21:24 UTC

    What's Changed

  2. v0.1.7Release 0.1.72026-01-05 · 2026-01-05 21:47 UTC
    查看更新说明

    What's Changed

  3. v0.1.6Release 0.1.62025-08-29 · 2025-08-29 03:57 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/hao-ai-lab/FastVideo/compare/v0.1.5...v0.1.6

  4. v0.1.5Release 0.1.52025-08-06 · 2025-08-06 20:09 UTC
    查看更新说明

    What's Changed

  5. v0.1.22025-07-15 · 2025-07-15 19:26 UTC
    查看更新说明

    Last release before removal of v0 code.

    What's Changed

    Full Changelog: https://github.com/hao-ai-lab/FastVideo/compare/v0.1.1...v0.1.2

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

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

    Recent news

    • 2026/10/21: Release FastH3 Omni (Ref2VA): reference-conditioned video-and-audio generation from a prompt plus ordered image, video and audio references, in eight fused forwards. It runs on consumer Blackwell (RTX 5090, RTX PRO 6000, DGX Spark — NVFP4 QAD), on RTX 4090 (FP8) and on Apple Silicon (MLX). See the cookbook and the inference guide.
    • 2026/10/06: FastVideo now supports Kandinsky 6 from Kandinsky Lab: text- and image-to-video with synchronized audio (base and 10-step distilled pi-Flow checkpoints) plus video super-resolution up to 4x. See the Kandinsky 6 recipes.
    • 2026/10/06: FastH3 V2 now runs on a single consumer machine: NVIDIA RTX 5090, RTX 4090 and RTX PRO 6000 GPUs, DGX Spark and Apple Silicon. We also release FastH3 Trim, an experimental pruned model that is 4.2× smaller than base H3 and runs in as little as 8 GB of GPU memory. Get the models and read the Blog.
    • 2026/09/15: Release FastH3 8-Step V2, an eight-forward data-free DMD2 checkpoint distilled from MiniMax-H3 with 80% Video Sparse Attention. Run it with examples/inference/basic/basic_fasth3_8step.py or the FastH3 8-Step V2 recipe.
    • 2026/09/01: FastH3 now runs locally on Apple Silicon through MLX and on NVIDIA DGX Spark through CUDA 13, including two-Spark inference. Follow the FastH3 recipes and read the Blog.
    • 2026/08/27: FastH3 Preview v1 is an open-weight 4-step sparse-distilled MiniMax-H3 model for synchronized video-and-audio generation, developed in collaboration with Nuva Lab and the NVIDIA FastGen team. Download the recommended VSA / Data-Free weights, or see the full FastH3 collection.
    • 2026/08/19: FastVideo now supports MLX on Apple Silicon with FastMetal-QAD, a family of 1.3B, 5B, and 14B models optimized for Mac. Follow the MLX install guide and read the Blog.

    More News

    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
      • Sparse distillation to achieve >50x denoising speedup
      • Scalable training with FSDP2, sequence parallelism, and selective activation checkpointing.
      • Causal distillation through Self-Forcing
      • See this page for the supported training workflows, and the support matrix for supported models.
    • 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 for full list of supported optimizations.
    • Diverse hardware and OS support
      • Support H100, A100, 4090
      • Support Linux, Windows, MacOS
      • See this page for full list of supported models, hardware assumptions, and optimization compatibility.
    • Realtime video generation & editing
      • Dreamverse: stream and "vibe direct" video in realtime (live demo), deployable on local GPU, a self-hosted B200 server, Docker, or serverless Modal

    Getting Started

    Install FastVideo with uv:

    uv venv --python 3.12 --seed
    source .venv/bin/activate
    
    # NVIDIA CUDA 12; use cu130 on CUDA 13
    UV_TORCH_BACKEND=cu126 uv pip install fastvideo
    

    Platform guides: NVIDIA GPUs, DGX Spark / GB10, Apple Silicon MLX, AMD / ROCm — or the full installation guide.

    To have a coding agent do the install, give it the agent install prompt.

    Sparse Distillation

    Sparse distillation reaches >50× denoising speedup. See the distillation guide and the blog; the training recipes live under examples/distill/ with the FastVideo Synthetic datasets.

    Dreamverse — Realtime Video Generation & Editing

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

    Try the live demo, read the blog, or run it yourself. Dreamverse deploys on a local GPU, a self-hosted B200 server over SSH, Docker, or serverless Modal — see the Dreamverse README.

    Inference

    Generating Your First Video

    Here's a minimal example to generate a video using the default settings. Make sure VSA kernels are installed. Create a file called example.py with the following code:

    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()
    

    num_gpus=1 runs the worker in-process (weights load once, no extra Python process). On Colab/Kaggle-style machines with ~16GB host RAM, keep num_gpus=1; free-tier system memory does not grow with extra T4s, so num_gpus>1 is likely to OOM.

    Run the script with:

    python example.py
    

    For a more detailed guide, please see our inference quick start.

    More Guides

    Awesome work using FastVideo or our research projects

    • SGLang: SGLang's diffusion inference functionality is based on a fork of FastVideo on Sept. 24, 2025.
    • DanceGRPO: A unified framework to adapt Group Relative Policy Optimization (GRPO) to visual generation paradigms. Code based on FastVideo.
    • SRPO: A method to directly align the full diffusion trajectory with fine-grained human preference. Code based on FastVideo.
    • DCM: Dual-expert consistency model for efficient and high-quality video generation. Code based on FastVideo.
    • HY-WorldPlay: An action-conditioned world model model trained using FastVideo framework.
    • Hunyuan Video 1.5: A leading lightweight video generation model, where they proposed SSTA based on Sliding Tile Attention.
    • Kandinsky-5.0: A family of diffusion models for video & image generation, where their NABLA attention includes a Sliding Tile Attention branch.
    • 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. See details in development roadmap.

    Acknowledgement

    We learned the design and reused code from the following projects: Wan-Video, ThunderKittens, DMD2, diffusers, xDiT, vLLM, SGLang. We thank MBZUAI, Anyscale, and GMI Cloud for their support throughout this project.

    Citation

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

    @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}
    }