StreamDiffusion: A Pipeline-Level Solution for Real-Time Interactive Generation
Authors: Akio Kodaira*, Chenfeng Xu*, Toshiki Hazama*, Takanori Yoshimoto, Kohei Ohno, Shogo Mitsuhori, Soichi Sugano, Hanying Cho, Zhijian Liu, Masayoshi Tomizuka, Kurt Keutzer
StreamDiffusion is an innovative diffusion pipeline designed for real-time interactive generation. It introduces significant performance enhancements to current diffusion-based image generation techniques.
We sincerely thank Taku Fujimoto and Radamés Ajna and Hugging Face team for their invaluable feedback, courteous support, and insightful discussions.
-
Stream Batch
- Streamlined data processing through efficient batch operations.
-
Residual Classifier-Free Guidance - Learn More
- Improved guidance mechanism that minimizes computational redundancy.
-
Stochastic Similarity Filter - Learn More
- Improves GPU utilization efficiency through advanced filtering techniques.
-
IO Queues
- Efficiently manages input and output operations for smoother execution.
-
Pre-Computation for KV-Caches
- Optimizes caching strategies for accelerated processing.
-
Model Acceleration Tools
- Utilizes various tools for model optimization and performance boost.
When images are produced using our proposed StreamDiffusion pipeline in an environment with GPU: RTX 4090, CPU: Core i9-13900K, and OS: Ubuntu 22.04.3 LTS.
| model | Denoising Step | fps on Txt2Img | fps on Img2Img |
|---|---|---|---|
| SD-turbo | 1 | 106.16 | 93.897 |
| LCM-LoRA + KohakuV2 |
4 | 38.023 | 37.133 |
Feel free to explore each feature by following the provided links to learn more about StreamDiffusion's capabilities. If you find it helpful, please consider citing our work:
@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 Kurt Keutzer},
year={2023},
eprint={2312.12491},
archivePrefix={arXiv},
primaryClass={cs.CV}
}git clone https://github.com/cumulo-autumn/StreamDiffusion.gitYou can install StreamDiffusion via pip, conda, or Docker(explanation below).
conda create -n streamdiffusion python=3.10
conda activate streamdiffusionOR
python -m venv .venv
# Windows
.\.venv\Scripts\activate
# Linux
source .venv/bin/activateSelect the appropriate version for your system.
CUDA 11.8
pip3 install torch==2.1.0 torchvision==0.16.0 xformers --index-url https://download.pytorch.org/whl/cu118CUDA 12.1
pip3 install torch==2.1.0 torchvision==0.16.0 xformers --index-url https://download.pytorch.org/whl/cu121details: https://pytorch.org/
Install StreamDiffusion
#for Latest Version (recommended)
pip install git+https://github.com/cumulo-autumn/StreamDiffusion.git@main#egg=streamdiffusion[tensorrt]
#or
#for Stable Version
pip install streamdiffusion[tensorrt]Install TensorRT extension
python -m streamdiffusion.tools.install-tensorrt(Only for Windows) You may need to install pywin32 additionally, if you installed Stable Version(pip install streamdiffusion[tensorrt]).
pip install --force-reinstall pywin32python setup.py develop easy_install streamdiffusion[tensorrt]
python -m streamdiffusion.tools.install-tensorrtgit clone https://github.com/cumulo-autumn/StreamDiffusion.git
cd StreamDiffusion
docker build -t stream-diffusion:latest -f Dockerfile .
docker run --gpus all -it -v $(pwd):/home/ubuntu/streamdiffusion stream-diffusion:latestYou can try StreamDiffusion in examples directory.
|
|
|---|---|
|
|
There is an interactive txt2img demo in demo/realtime-txt2img directory!
There is a real time img2img demo with a live webcam feed or screen capture on a web browser in demo/realtime-img2img directory!
We provide a simple example of how to use StreamDiffusion. For more detailed examples, please refer to examples directory.
from https://github.com/cumulo-autumn/StreamDiffusion






No comments:
Post a Comment