Metadata-Version: 2.4
Name: turbodiffusion
Version: 1.0.0
Summary: TurboDiffusion: video generation acceleration framework that could accelerate end-to-end video generation by 100-205x with negligible video quality loss.
Author: Jintao Zhang, Kaiwen Zheng, Kai Jiang, Haoxu Wang
License:                                 Apache License
                                   Version 2.0, January 2004
                                http://www.apache.org/licenses/
        
           TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
        
           1. Definitions.
        
              "License" shall mean the terms and conditions for use, reproduction,
              and distribution as defined by Sections 1 through 9 of this document.
        
              "Licensor" shall mean the copyright owner or entity authorized by
              the copyright owner that is granting the License.
        
              "Legal Entity" shall mean the union of the acting entity and all
              other entities that control, are controlled by, or are under common
              control with that entity. For the purposes of this definition,
              "control" means (i) the power, direct or indirect, to cause the
              direction or management of such entity, whether by contract or
              otherwise, or (ii) ownership of fifty percent (50%) or more of the
              outstanding shares, or (iii) beneficial ownership of such entity.
        
              "You" (or "Your") shall mean an individual or Legal Entity
              exercising permissions granted by this License.
        
              "Source" form shall mean the preferred form for making modifications,
              including but not limited to software source code, documentation
              source, and configuration files.
        
              "Object" form shall mean any form resulting from mechanical
              transformation or translation of a Source form, including but
              not limited to compiled object code, generated documentation,
              and conversions to other media types.
        
              "Work" shall mean the work of authorship, whether in Source or
              Object form, made available under the License, as indicated by a
              copyright notice that is included in or attached to the work
              (an example is provided in the Appendix below).
        
              "Derivative Works" shall mean any work, whether in Source or Object
              form, that is based on (or derived from) the Work and for which the
              editorial revisions, annotations, elaborations, or other modifications
              represent, as a whole, an original work of authorship. For the purposes
              of this License, Derivative Works shall not include works that remain
              separable from, or merely link (or bind by name) to the interfaces of,
              the Work and Derivative Works thereof.
        
              "Contribution" shall mean any work of authorship, including
              the original version of the Work and any modifications or additions
              to that Work or Derivative Works thereof, that is intentionally
              submitted to Licensor for inclusion in the Work by the copyright owner
              or by an individual or Legal Entity authorized to submit on behalf of
              the copyright owner. For the purposes of this definition, "submitted"
              means any form of electronic, verbal, or written communication sent
              to the Licensor or its representatives, including but not limited to
              communication on electronic mailing lists, source code control systems,
              and issue tracking systems that are managed by, or on behalf of, the
              Licensor for the purpose of discussing and improving the Work, but
              excluding communication that is conspicuously marked or otherwise
              designated in writing by the copyright owner as "Not a Contribution."
        
              "Contributor" shall mean Licensor and any individual or Legal Entity
              on behalf of whom a Contribution has been received by Licensor and
              subsequently incorporated within the Work.
        
           2. Grant of Copyright License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              copyright license to reproduce, prepare Derivative Works of,
              publicly display, publicly perform, sublicense, and distribute the
              Work and such Derivative Works in Source or Object form.
        
           3. Grant of Patent License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              (except as stated in this section) patent license to make, have made,
              use, offer to sell, sell, import, and otherwise transfer the Work,
              where such license applies only to those patent claims licensable
              by such Contributor that are necessarily infringed by their
              Contribution(s) alone or by combination of their Contribution(s)
              with the Work to which such Contribution(s) was submitted. If You
              institute patent litigation against any entity (including a
              cross-claim or counterclaim in a lawsuit) alleging that the Work
              or a Contribution incorporated within the Work constitutes direct
              or contributory patent infringement, then any patent licenses
              granted to You under this License for that Work shall terminate
              as of the date such litigation is filed.
        
           4. Redistribution. You may reproduce and distribute copies of the
              Work or Derivative Works thereof in any medium, with or without
              modifications, and in Source or Object form, provided that You
              meet the following conditions:
        
              (a) You must give any other recipients of the Work or
                  Derivative Works a copy of this License; and
        
              (b) You must cause any modified files to carry prominent notices
                  stating that You changed the files; and
        
              (c) You must retain, in the Source form of any Derivative Works
                  that You distribute, all copyright, patent, trademark, and
                  attribution notices from the Source form of the Work,
                  excluding those notices that do not pertain to any part of
                  the Derivative Works; and
        
              (d) If the Work includes a "NOTICE" text file as part of its
                  distribution, then any Derivative Works that You distribute must
                  include a readable copy of the attribution notices contained
                  within such NOTICE file, excluding those notices that do not
                  pertain to any part of the Derivative Works, in at least one
                  of the following places: within a NOTICE text file distributed
                  as part of the Derivative Works; within the Source form or
                  documentation, if provided along with the Derivative Works; or,
                  within a display generated by the Derivative Works, if and
                  wherever such third-party notices normally appear. The contents
                  of the NOTICE file are for informational purposes only and
                  do not modify the License. You may add Your own attribution
                  notices within Derivative Works that You distribute, alongside
                  or as an addendum to the NOTICE text from the Work, provided
                  that such additional attribution notices cannot be construed
                  as modifying the License.
        
              You may add Your own copyright statement to Your modifications and
              may provide additional or different license terms and conditions
              for use, reproduction, or distribution of Your modifications, or
              for any such Derivative Works as a whole, provided Your use,
              reproduction, and distribution of the Work otherwise complies with
              the conditions stated in this License.
        
           5. Submission of Contributions. Unless You explicitly state otherwise,
              any Contribution intentionally submitted for inclusion in the Work
              by You to the Licensor shall be under the terms and conditions of
              this License, without any additional terms or conditions.
              Notwithstanding the above, nothing herein shall supersede or modify
              the terms of any separate license agreement you may have executed
              with Licensor regarding such Contributions.
        
           6. Trademarks. This License does not grant permission to use the trade
              names, trademarks, service marks, or product names of the Licensor,
              except as required for reasonable and customary use in describing the
              origin of the Work and reproducing the content of the NOTICE file.
        
           7. Disclaimer of Warranty. Unless required by applicable law or
              agreed to in writing, Licensor provides the Work (and each
              Contributor provides its Contributions) on an "AS IS" BASIS,
              WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
              implied, including, without limitation, any warranties or conditions
              of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
              PARTICULAR PURPOSE. You are solely responsible for determining the
              appropriateness of using or redistributing the Work and assume any
              risks associated with Your exercise of permissions under this License.
        
           8. Limitation of Liability. In no event and under no legal theory,
              whether in tort (including negligence), contract, or otherwise,
              unless required by applicable law (such as deliberate and grossly
              negligent acts) or agreed to in writing, shall any Contributor be
              liable to You for damages, including any direct, indirect, special,
              incidental, or consequential damages of any character arising as a
              result of this License or out of the use or inability to use the
              Work (including but not limited to damages for loss of goodwill,
              work stoppage, computer failure or malfunction, or any and all
              other commercial damages or losses), even if such Contributor
              has been advised of the possibility of such damages.
        
           9. Accepting Warranty or Additional Liability. While redistributing
              the Work or Derivative Works thereof, You may choose to offer,
              and charge a fee for, acceptance of support, warranty, indemnity,
              or other liability obligations and/or rights consistent with this
              License. However, in accepting such obligations, You may act only
              on Your own behalf and on Your sole responsibility, not on behalf
              of any other Contributor, and only if You agree to indemnify,
              defend, and hold each Contributor harmless for any liability
              incurred by, or claims asserted against, such Contributor by reason
              of your accepting any such warranty or additional liability.
        
           END OF TERMS AND CONDITIONS
        
           APPENDIX: How to apply the Apache License to your work.
        
              To apply the Apache License to your work, attach the following
              boilerplate notice, with the fields enclosed by brackets "[]"
              replaced with your own identifying information. (Don't include
              the brackets!)  The text should be enclosed in the appropriate
              comment syntax for the file format. We also recommend that a
              file or class name and description of purpose be included on the
              same "printed page" as the copyright notice for easier
              identification within third-party archives.
        
           Copyright [yyyy] [name of copyright owner]
        
           Licensed under the Apache License, Version 2.0 (the "License");
           you may not use this file except in compliance with the License.
           You may obtain a copy of the License at
        
               http://www.apache.org/licenses/LICENSE-2.0
        
           Unless required by applicable law or agreed to in writing, software
           distributed under the License is distributed on an "AS IS" BASIS,
           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
           See the License for the specific language governing permissions and
           limitations under the License.
        
Project-URL: Homepage, https://github.com/thu-ml/TurboDiffusion
Project-URL: Repository, https://github.com/thu-ml/TurboDiffusion
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=2.7.0
Requires-Dist: torchvision
Requires-Dist: triton>=3.3.0
Requires-Dist: flash-attn
Requires-Dist: einops
Requires-Dist: numpy
Requires-Dist: pillow
Requires-Dist: loguru
Requires-Dist: imageio[ffmpeg]
Requires-Dist: pandas
Requires-Dist: PyYAML
Requires-Dist: omegaconf
Requires-Dist: attrs
Requires-Dist: fvcore
Requires-Dist: ftfy
Requires-Dist: regex
Requires-Dist: transformers
Requires-Dist: nvidia-ml-py
Dynamic: license-file

# TurboDiffusion

<div align="center">
<img src=assets/TurboDiffusion_Logo.png width="30%"/>
</div>

This repository provides the official implementation of **TurboDiffusion**, a video generation acceleration framework that can speed up end-to-end diffusion generation by $100 \sim 205\times$ on a single RTX 5090, while maintaining video quality. Currently, this repository contains the model checkpoints and inference code. The training code will be released in the future.


Paper: [TurboDiffusion: Accelerating Video Diffusion Models by 100--205 Times](https://jt-zhang.github.io/files/TurboDiffusion_Technical_Report.pdf)

<div align="center">
<img src="assets/TurboDiffusion_speedup.png" width="100%"/>
</div>

<div align="center">

<table>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 166s</div>
<div><img src="assets/videos/original/1.3B/11.gif" width="387"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>1.8s</b></div>
<div><img src="assets/videos/turbodiffusion/1.3B/11.gif" width="387"/></div>
</td>
</tr>
</table>
An example of a <b>5-second video</b> generated by Wan-2.1-T2V-1.3B-480P on a single <b>RTX 5090</b>.
</div>


## Available Models

|              Model Name               |                       Checkpoint Link                        | Best Resolution |
| :-----------------------------------: | :----------------------------------------------------------: | :-------------: |
| `TurboWan2.1-T2V-1.3B-480P` | [Huggingface Model](https://huggingface.co/TurboDiffusion/TurboWan2.1-T2V-1.3B-480P) | 480p            |
| `TurboWan2.1-T2V-14B-480P`  | [Huggingface Model](https://huggingface.co/TurboDiffusion/TurboWan2.1-T2V-14B-480P) | 480p            |
| `TurboWan2.1-T2V-14B-720P`  | [Huggingface Model](https://huggingface.co/TurboDiffusion/TurboWan2.1-T2V-14B-720P) | 720p            |
| `TurboWan2.2-I2V-A14B-720P` | [Huggingface Model](https://huggingface.co/TurboDiffusion/TurboWan2.2-I2V-A14B-720P) | 720p            |


Note: All checkpoints support generating videos at 480p or 720p. The "Best Resolution" column indicates the resolution at which the model provides the best video quality.


## Installation

**Base environment**: `python>=3.9`, `torch>=2.7.0`. `torch==2.8.0` is recommended, as higher versions may cause OOM.

Install TurboDiffusion by pip:

```bash
conda create -n turbodiffusion python=3.12
conda activate turbodiffusion

pip install turbodiffusion --no-build-isolation
```

Or compile from source:

```bash
git clone https://github.com/thu-ml/TurboDiffusion.git
cd TurboDiffusion
git submodule update --init --recursive
pip install -e . --no-build-isolation
```

To enable SageSLA (Sparse-Linear Attention based on SageAttention), install [SpargeAttn](https://github.com/thu-ml/SpargeAttn) first:

```bash
pip install git+https://github.com/thu-ml/SpargeAttn.git --no-build-isolation
```

## Inference


1.  Download the Wan2.1 VAE and umT5 text encoder checkpoints from the official [Wan2.1](https://huggingface.co/Wan-AI/Wan2.1-T2V-1.3B) repository on Huggingface:

    ```bash
    mkdir checkpoints
    cd checkpoints
    wget https://huggingface.co/Wan-AI/Wan2.1-T2V-1.3B/resolve/main/Wan2.1_VAE.pth
    wget https://huggingface.co/Wan-AI/Wan2.1-T2V-1.3B/resolve/main/models_t5_umt5-xxl-enc-bf16.pth
    ```

2.  Download our finetuned checkpoints:
    ```bash
    wget https://huggingface.co/TurboDiffusion/TurboWan2.1-T2V-1.3B-480P/resolve/main/TurboWan2.1-T2V-1.3B-480P.pth
    ```
    
    For RTX 5090, RTX 4090, or similar GPUs, please use the quantized checkpoint:

    ```bash
    wget https://huggingface.co/TurboDiffusion/TurboWan2.1-T2V-1.3B-480P/resolve/main/TurboWan2.1-T2V-1.3B-480P-quant.pth
    ```
    
    For GPUs with a bigger GPU memory than 40GB, e.g., H100, we recommend using the unquantized checkpoint.

    For the I2V model, download both the high-noise and low-noise checkpoints:
    ```bash
    wget https://huggingface.co/TurboDiffusion/TurboWan2.2-I2V-A14B-720P/resolve/main/TurboWan2.2-I2V-A14B-high-720P.pth
    wget https://huggingface.co/TurboDiffusion/TurboWan2.2-I2V-A14B-720P/resolve/main/TurboWan2.2-I2V-A14B-low-720P.pth
    ```

3.  Use the inference script for the T2V model:
    ```bash
    export PYTHONPATH=turbodiffusion
    
    # Arguments:
    # --dit_path            Path to the finetuned TurboDiffusion checkpoint
    # --model               Model to use: Wan2.1-1.3B or Wan2.1-14B (default: Wan2.1-1.3B)
    # --num_samples         Number of videos to generate (default: 1)
    # --num_steps           Sampling steps, 1–4 (default: 4)
    # --sigma_max           Initial sigma for rCM (default: 80); larger choices (e.g., 1600) reduce diversity but may enhance quality
    # --vae_path            Path to Wan2.1 VAE (default: checkpoints/Wan2.1_VAE.pth)
    # --text_encoder_path   Path to umT5 text encoder (default: checkpoints/models_t5_umt5-xxl-enc-bf16.pth)
    # --num_frames          Number of frames to generate (default: 77)
    # --prompt              Text prompt for video generation
    # --resolution          Output resolution: "480p" or "720p" (default: 480p)
    # --aspect_ratio        Aspect ratio in W:H format (default: 16:9)
    # --seed                Random seed for reproducibility (default: 0)
    # --save_path           Output file path including extension (default: output/generated_video.mp4)
    # --attention_type      Attention module to use: original, sla or sagesla (default: sagesla)
    # --sla_topk            Top-k ratio for SLA/SageSLA attention (default: 0.1), we recommend using 0.15 for better video quality
    # --quant_linear        Enable quantization for linear layers, pass this if using a quantized checkpoint
    # --default_norm        Use the original LayerNorm and RMSNorm of Wan models

    python turbodiffusion/inference/wan2.1_t2v_infer.py \
        --model Wan2.1-1.3B \
        --dit_path checkpoints/TurboWan2.1-T2V-1.3B-480P-quant.pth \
        --resolution 480p \
        --prompt "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse. She wears sunglasses and red lipstick. She walks confidently and casually. The street is damp and reflective, creating a mirror effect of the colorful lights. Many pedestrians walk about." \
        --num_samples 1 \
        --num_steps 4 \
        --quant_linear \
        --attention_type sagesla \
        --sla_topk 0.1
    ```

    Or the script for the I2V model:
    ```bash
    export PYTHONPATH=turbodiffusion

    # --image_path              Path to the input image
    # --high_noise_model_path   Path to the high noise TurboDiffusion checkpoint
    # --low_noise_model_path    Path to the high noise TurboDiffusion checkpoint
    # --boundary                Timestep boundary for switching from high to low noise model (default: 0.9)
    # --model                   Model to use: Wan2.2-A14B (default: Wan2.2-A14B)
    # --num_samples             Number of videos to generate (default: 1)
    # --num_steps               Sampling steps, 1–4 (default: 4)
    # --sigma_max               Initial sigma for rCM (default: 200); larger choices (e.g., 1600) reduce diversity but may enhance quality
    # --vae_path                Path to Wan2.2 VAE (default: checkpoints/Wan2.2_VAE.pth)
    # --text_encoder_path       Path to umT5 text encoder (default: checkpoints/models_t5_umt5-xxl-enc-bf16.pth)
    # --num_frames              Number of frames to generate (default: 77)
    # --prompt                  Text prompt for video generation
    # --resolution              Output resolution: "480p" or "720p" (default: 720p)
    # --aspect_ratio            Aspect ratio in W:H format (default: 16:9)
    # --adaptive_resolution     Enable adaptive resolution based on input image size
    # --ode                     Use ODE for sampling (sharper but less robust than SDE)
    # --seed                    Random seed for reproducibility (default: 0)
    # --save_path               Output file path including extension (default: output/generated_video.mp4)
    # --attention_type          Attention module to use: original, sla or sagesla (default: sagesla)
    # --sla_topk                Top-k ratio for SLA/SageSLA attention (default: 0.1), we recommend using 0.15 for better video quality
    # --quant_linear            Enable quantization for linear layers, pass this if using a quantized checkpoint
    # --default_norm            Use the original LayerNorm and RMSNorm of Wan models

    python turbodiffusion/inference/wan2.2_i2v_infer.py \
        --model Wan2.2-A14B \
        --low_noise_model_path checkpoints/TurboWan2.2-I2V-A14B-low-720P-quant.pth \
        --high_noise_model_path checkpoints/TurboWan2.2-I2V-A14B-high-720P-quant.pth \
        --resolution 720p \
        --adaptive_resolution \
        --image_path assets/i2v_inputs/i2v_input_0.jpg \
        --prompt "POV selfie video, ultra-messy and extremely fast. A white cat in sunglasses stands on a surfboard with a neutral look when the board suddenly whips sideways, throwing cat and camera into the water; the frame dives sharply downward, swallowed by violent bursts of bubbles, spinning turbulence, and smeared water streaks as the camera sinks. Shadows thicken, pressure ripples distort the edges, and loose bubbles rush upward past the lens, showing the camera is still sinking. Then the cat kicks upward with explosive speed, dragging the view through churning bubbles and rapidly brightening water as sunlight floods back in; the camera races upward, water streaming off the lens, and finally breaks the surface in a sudden blast of light and spray, snapping back into a crooked, frantic selfie as the cat resurfaces." \
        --num_samples 1 \
        --num_steps 4 \
        --quant_linear \
        --attention_type sagesla \
        --sla_topk 0.1 \
        --ode
    ```

## Evaluation

We evaluate video generation on **a single RTX 5090 GPU**. The E2E Time refers to the end-to-end diffusion generation latency, excluding text encoding and VAE decoding.

### Wan-2.2-I2V-A14B-720P

<table>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 4183s</div>
<div><img src="assets/videos/i2v/original/A14B_720p/gif/0.gif" width="360"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>35.4s</b></div>
<div><img src="assets/videos/i2v/turbodiffusion/A14B_720p/gif/0.gif" width="360"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 4183s</div>
<div><img src="assets/videos/i2v/original/A14B_720p/gif/1.gif" width="360"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>35.4s</b></div>
<div><img src="assets/videos/i2v/turbodiffusion/A14B_720p/gif/1.gif" width="360"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 4183s</div>
<div><img src="assets/videos/i2v/original/A14B_720p/gif/2.gif" width="360"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>35.4s</b></div>
<div><img src="assets/videos/i2v/turbodiffusion/A14B_720p/gif/2.gif" width="360"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 4183s</div>
<div><img src="assets/videos/i2v/original/A14B_720p/gif/3.gif" width="360"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>35.4s</b></div>
<div><img src="assets/videos/i2v/turbodiffusion/A14B_720p/gif/3.gif" width="360"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 4183s</div>
<div><img src="assets/videos/i2v/original/A14B_720p/gif/4.gif" width="360"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>35.4s</b></div>
<div><img src="assets/videos/i2v/turbodiffusion/A14B_720p/gif/4.gif" width="360"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 4183s</div>
<div><img src="assets/videos/i2v/original/A14B_720p/gif/5.gif" width="360"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>35.4s</b></div>
<div><img src="assets/videos/i2v/turbodiffusion/A14B_720p/gif/5.gif" width="360"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 4183s</div>
<div><img src="assets/videos/i2v/original/A14B_720p/gif/6.gif" width="360"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>35.4s</b></div>
<div><img src="assets/videos/i2v/turbodiffusion/A14B_720p/gif/6.gif" width="360"/></div>
</td>
</tr>
</table>


### Wan-2.1-T2V-1.3B-480P

<table>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 166s</div>
<div><img src="assets/videos/original/1.3B/0.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 4.7s</div>
<div><img src="assets/videos/fastvideo/video_1.3B/0.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>1.8s</b></div>
<div><img src="assets/videos/turbodiffusion/1.3B/0.gif" width="249"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 166s</div>
<div><img src="assets/videos/original/1.3B/1.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 4.7s</div>
<div><img src="assets/videos/fastvideo/video_1.3B/1.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>1.8s</b></div>
<div><img src="assets/videos/turbodiffusion/1.3B/1.gif" width="249"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 166s</div>
<div><img src="assets/videos/original/1.3B/2.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 4.7s</div>
<div><img src="assets/videos/fastvideo/video_1.3B/2.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>1.8s</b></div>
<div><img src="assets/videos/turbodiffusion/1.3B/2.gif" width="249"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 166s</div>
<div><img src="assets/videos/original/1.3B/5.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 4.7s</div>
<div><img src="assets/videos/fastvideo/video_1.3B/5.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>1.8s</b></div>
<div><img src="assets/videos/turbodiffusion/1.3B/5.gif" width="249"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 166s</div>
<div><img src="assets/videos/original/1.3B/7.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 4.7s</div>
<div><img src="assets/videos/fastvideo/video_1.3B/7.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>1.8s</b></div>
<div><img src="assets/videos/turbodiffusion/1.3B/7.gif" width="249"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 166s</div>
<div><img src="assets/videos/original/1.3B/8.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 4.7s</div>
<div><img src="assets/videos/fastvideo/video_1.3B/8.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>1.8s</b></div>
<div><img src="assets/videos/turbodiffusion/1.3B/8.gif" width="249"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 166s</div>
<div><img src="assets/videos/original/1.3B/11.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 4.7s</div>
<div><img src="assets/videos/fastvideo/video_1.3B/11.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>1.8s</b></div>
<div><img src="assets/videos/turbodiffusion/1.3B/11.gif" width="249"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 166s</div>
<div><img src="assets/videos/original/1.3B/13.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 4.7s</div>
<div><img src="assets/videos/fastvideo/video_1.3B/13.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>1.8s</b></div>
<div><img src="assets/videos/turbodiffusion/1.3B/13.gif" width="249"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 166s</div>
<div><img src="assets/videos/original/1.3B/14.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 4.7s</div>
<div><img src="assets/videos/fastvideo/video_1.3B/14.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>1.8s</b></div>
<div><img src="assets/videos/turbodiffusion/1.3B/14.gif" width="249"/></div>
</td>
</tr>
</table>


### Wan-2.1-T2V-14B-720P

<table>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 4648s</div>
<div><img src="assets/videos/original/14B_720p/0.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 63.5s</div>
<div><img src="assets/videos/fastvideo/video_14B_720p/0.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>22.7s</b></div>
<div><img src="assets/videos/turbodiffusion/14B_720p/0.gif" width="249"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 4648s</div>
<div><img src="assets/videos/original/14B_720p/2.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 63.5s</div>
<div><img src="assets/videos/fastvideo/video_14B_720p/2.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>22.7s</b></div>
<div><img src="assets/videos/turbodiffusion/14B_720p/2.gif" width="249"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 4648s</div>
<div><img src="assets/videos/original/14B_720p/3.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 63.5s</div>
<div><img src="assets/videos/fastvideo/video_14B_720p/3.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>22.7s</b></div>
<div><img src="assets/videos/turbodiffusion/14B_720p/3.gif" width="249"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 4648s</div>
<div><img src="assets/videos/original/14B_720p/6.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 63.5s</div>
<div><img src="assets/videos/fastvideo/video_14B_720p/6.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>22.7s</b></div>
<div><img src="assets/videos/turbodiffusion/14B_720p/6.gif" width="249"/></div>
</td>
</tr>
</table>


### Wan-2.1-T2V-14B-480P

<table>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 1635s</div>
<div><img src="assets/videos/original/14B_480p/0.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 23.2s</div>
<div><img src="assets/videos/fastvideo/video_14B_480p/0.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>9.4s</b></div>
<div><img src="assets/videos/turbodiffusion/14B_480p/0.gif" width="249"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 1635s</div>
<div><img src="assets/videos/original/14B_480p/1.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 23.2s</div>
<div><img src="assets/videos/fastvideo/video_14B_480p/1.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>9.4s</b></div>
<div><img src="assets/videos/turbodiffusion/14B_480p/1.gif" width="249"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 1635s</div>
<div><img src="assets/videos/original/14B_480p/4.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 23.2s</div>
<div><img src="assets/videos/fastvideo/video_14B_480p/4.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>9.4s</b></div>
<div><img src="assets/videos/turbodiffusion/14B_480p/4.gif" width="249"/></div>
</td>
</tr>
<tr>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">Original, E2E Time: 1635s</div>
<div><img src="assets/videos/original/14B_480p/5.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">FastVideo, E2E Time: 23.2s</div>
<div><img src="assets/videos/fastvideo/video_14B_480p/5.gif" width="249"/></div>
</td>
<td align="center" style="border: 2px solid #000; padding: 10px;">
<div style="font-size: 1.1em;">TurboDiffusion, E2E Time: <b>9.4s</b></div>
<div><img src="assets/videos/turbodiffusion/14B_480p/5.gif" width="249"/></div>
</td>
</tr>
</table>


## Roadmap

We're actively working on the following features and improvements:

- [ ] Organize and release training code
- [ ] vLLM-Omni integration
- [ ] Support for more video generation models
- [ ] Support for autoregressive video generation models
- [ ] More hardware-level operator optimizations


We welcome community members to help maintain and extend TurboDiffusion. We appreciate your interest in contributing. Welcome to join the TurboDiffusion Team and contribute together!


## Citation
**If you use this code or find our work valuable, please cite:**
```
@article{zhang2025turbodiffusion,
  title={TurboDiffusion: Accelerating Video Diffusion Models by 100--205 Times},
  author={Zhang, Jintao and Zheng, Kaiwen and Jiang, Kai and Wang, Haoxu and Stoica, Ion and Gonzalez, Joseph E. and Chen, Jianfei and Zhu, Jun},
  year={2025}
}

@software{turbodiffusion2025,
  title={TurboDiffusion: Accelerating Video Diffusion Models by 100--205 Times},
  author       = {The TurboDiffusion Team},
  url          = {https://github.com/thu-ml/TurboDiffusion},
  year={2025}
}

@inproceedings{zhang2025sageattention,
  title={SageAttention: Accurate 8-Bit Attention for Plug-and-play Inference Acceleration}, 
  author={Zhang, Jintao and Wei, Jia and Zhang, Pengle and Zhu, Jun and Chen, Jianfei},
  booktitle={International Conference on Learning Representations (ICLR)},
  year={2025}
}

@article{zhang2025sla,
  title={SLA: Beyond Sparsity in Diffusion Transformers via Fine-Tunable Sparse-Linear Attention},
  author={Zhang, Jintao and Wang, Haoxu and Jiang, Kai and Yang, Shuo and Zheng, Kaiwen and Xi, Haocheng and Wang, Ziteng and Zhu, Hongzhou and Zhao, Min and Stoica, Ion and Gonzalez, Joseph E. and Zhu, Jun and Chen, Jianfei},
  journal={arXiv preprint arXiv:2509.24006},
  year={2025}
}

@article{zheng2025rcm,
  title={Large Scale Diffusion Distillation via Score-Regularized Continuous-Time Consistency},
  author={Zheng, Kaiwen and Wang, Yuji and Ma, Qianli and Chen, Huayu and Zhang, Jintao and Balaji, Yogesh and Chen, Jianfei and Liu, Ming-Yu and Zhu, Jun and Zhang, Qinsheng},
  journal={arXiv preprint arXiv:2510.08431},
  year={2025}
}

@inproceedings{zhang2024sageattention2,
  title={Sageattention2: Efficient attention with thorough outlier smoothing and per-thread int4 quantization},
  author={Zhang, Jintao and Huang, Haofeng and Zhang, Pengle and Wei, Jia and Zhu, Jun and Chen, Jianfei},
  booktitle={International Conference on Machine Learning (ICML)},
  year={2025}
}
```

<!-- @article{zhang2025sageattention2++,
  title={Sageattention2++: A more efficient implementation of sageattention2},
  author={Zhang, Jintao and Xu, Xiaoming and Wei, Jia and Huang, Haofeng and Zhang, Pengle and Xiang, Chendong and Zhu, Jun and Chen, Jianfei},
  journal={arXiv preprint arXiv:2505.21136},
  year={2025}
}
@article{zhang2025sageattention3,
  title={SageAttention3: Microscaling FP4 Attention for Inference and An Exploration of 8-Bit Training},
  author={Zhang, Jintao and Wei, Jia and Zhang, Pengle and Xu, Xiaoming and Huang, Haofeng and Wang, Haoxu and Jiang, Kai and Zhu, Jun and Chen, Jianfei},
  journal={arXiv preprint arXiv:2505.11594},
  year={2025}
} -->
