T-Stitch: Accelerating Sampling in Pre-Trained Diffusion Models with Trajectory Stitching

Zizheng Pan, Bohan Zhuang, De-An Huang, Weili Nie, Zhiding Yu +3 more
2/21/2024
cs.CVcs.LG

Official code: NVlabs/T-Stitch (107 stars, last commit 2024-02-26).

Abstract

Sampling from diffusion probabilistic models (DPMs) is often expensive for high-quality image generation and typically requires many steps with a large model. In this paper, we introduce sampling Trajectory Stitching T-Stitch, a simple yet efficient technique to improve the sampling efficiency with little or no generation degradation. Instead of solely using a large DPM for the entire sampling trajectory, T-Stitch first leverages a smaller DPM in the initial steps as a cheap drop-in replacement of the larger DPM and switches to the larger DPM at a later stage. Our key insight is that different diffusion models learn similar encodings under the same training data distribution and smaller models are capable of generating good global structures in the early steps. Extensive experiments demonstrate that T-Stitch is training-free, generally applicable for different architectures, and complements most existing fast sampling techniques with flexible speed and quality trade-offs. On DiT-XL, for example, 40% of the early timesteps can be safely replaced with a 10x faster DiT-S without performance drop on class-conditional ImageNet generation. We further show that our method can also be used as a drop-in technique to not only accelerate the popular pretrained stable diffusion (SD) models but also improve the prompt alignment of stylized SD models from the public model zoo. Code is released at https://github.com/NVlabs/T-Stitch

View on arXivView PDF

Code Implementations(1)

NVlabs/T-StitchOfficial100%

[ICLR 2025] Official PyTorch implmentation of paper "T-Stitch: Accelerating Sampling in Pre-trained Diffusion Models with Trajectory Stitching"

1074Shell, PythonFeb 22, 20242 years agoNOASSERTION

Similar Papers

Cite this paper

@article{pan2024tstitch,
  title  = {T-Stitch: Accelerating Sampling in Pre-Trained Diffusion Models with Trajectory Stitching},
  author = {Zizheng Pan and Bohan Zhuang and De-An Huang and Weili Nie and Zhiding Yu and Chaowei Xiao and Jianfei Cai and Anima Anandkumar},
  year   = {2024},
  eprint = {2402.14167},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.14167v1},
  journal = {ICLR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.14167.svg)](https://codeofpaper.com/paper/2402.14167)

Discussion