StreamDiffusion: A Pipeline-level Solution for Real-time Interactive Generation

Akio Kodaira, Chenfeng Xu, Toshiki Hazama, Takanori Yoshimoto, Kohei Ohno +6 more
12/19/2023
cs.CVcs.GRcs.LG

No official code found. Best implementation: cumulo-autumn/StreamDiffusion (10,820 stars, Apache-2.0, last commit 2024-12-04). 1 more below.

Abstract

We introduce StreamDiffusion, a real-time diffusion pipeline designed for interactive image generation. Existing diffusion models are adept at creating images from text or image prompts, yet they often fall short in real-time interaction. This limitation becomes particularly evident in scenarios involving continuous input, such as Metaverse, live video streaming, and broadcasting, where high throughput is imperative. To address this, we present a novel approach that transforms the original sequential denoising into the batching denoising process. Stream Batch eliminates the conventional wait-and-interact approach and enables fluid and high throughput streams. To handle the frequency disparity between data input and model throughput, we design a novel input-output queue for parallelizing the streaming process. Moreover, the existing diffusion pipeline uses classifier-free guidance(CFG), which requires additional U-Net computation. To mitigate the redundant computations, we propose a novel residual classifier-free guidance (RCFG) algorithm that reduces the number of negative conditional denoising steps to only one or even zero. Besides, we introduce a stochastic similarity filter(SSF) to optimize power consumption. Our Stream Batch achieves around 1.5x speedup compared to the sequential denoising method at different denoising levels. The proposed RCFG leads to speeds up to 2.05x higher than the conventional CFG. Combining the proposed strategies and existing mature acceleration tools makes the image-to-image generation achieve up-to 91.07fps on one RTX4090, improving the throughputs of AutoPipline developed by Diffusers over 59.56x. Furthermore, our proposed StreamDiffusion also significantly reduces the energy consumption by 2.39x on one RTX3060 and 1.99x on one RTX4090, respectively.

View on arXivView PDF

Code Implementations(2)

Apache-2.0

StreamDiffusion: A Pipeline-Level Solution for Real-Time Interactive Generation

10,820835Python, DockerfileNov 28, 20231 years agoApache-2.0
Apache-2.0

StreamDiffusion: A Pipeline-Level Solution for Real-Time Interactive Generation

304Python, DockerfileOct 23, 20257 months agoApache-2.0

Similar Papers

Cite this paper

@article{kodaira2023streamdiffusion,
  title  = {StreamDiffusion: A Pipeline-level Solution for Real-time Interactive Generation},
  author = {Akio Kodaira and Chenfeng Xu and Toshiki Hazama and Takanori Yoshimoto and Kohei Ohno and Shogo Mitsuhori and Soichi Sugano and Hanying Cho and Zhijian Liu and Masayoshi Tomizuka and Kurt Keutzer},
  year   = {2023},
  eprint = {2312.12491},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2312.12491v2}
}

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/2312.12491.svg)](https://codeofpaper.com/paper/2312.12491)

Discussion