An out-of-the-box acceleration library for diffusion models (especially for ComfyUI, HF diffusers, and Stable Diffusion web UI).
Updated on Nov 6, 2023.
Device | SD1.5 (512x512) | SD2.1 (512x512) | SDXL1.0-base(1024x1024) |
---|---|---|---|
RTX 3090 | 42.38it/s | 42.33it/s | 6.66it/s |
RTX 4090 | 74.71it/s | 73.57it/s | 13.57it/s |
A100-PCIE-40GB | 54.4it/s | 54.06it/s | 10.22it/s |
A100-SXM4-80GB | 59.68it/s | 61.91it/s | 11.80it/s |
NOTE: OneDiff Enterprise Edition delivers even higher performance and second-to-none deployment flexibility.
- Acceleration for popular UIs/libs
- Acceleration for state-of-the-art Models
- Out-of-the-box acceleration
- Multi-resolution input
- Compile and save the compiled result offline, then load it online for serving
- Discord of OneDiff
- GitHub issues
If you need unrestricted multiple resolutions, quantization, dynamic batch size support or any other more advanced features, please send an email to business@siliconflow.com . Tell us about your use case, deployment scale, and requirements.
OneDiff Community | OneDiff Enterprise | |
---|---|---|
diffusers | Yes | Yes |
UNet/VAE/ControlNet Compilation | Yes | Yes |
LoRA | Limited | Yes |
LCM | Limited | Yes |
Multiple Resolutions | Limited | Yes |
ComfyUI | Community | Yes |
Stable Diffusion web UI | Community | Yes |
Technical Support | Community | Yes |
Quantization | Yes | |
Source Code Access | Yes |
NOTE: We only support Linux and NVIDIA GPUs for the moment. If you want to use OneDiff on Windows, please use it under WSL.
- Install OneFlow(For CUDA 11.8)
python3 -m pip install --pre oneflow -f https://oneflow-pro.oss-cn-beijing.aliyuncs.com/branch/community/cu118
Click to get OneFlow packages for other CUDA versions.
CUDA 12.1python3 -m pip install --pre oneflow -f https://oneflow-pro.oss-cn-beijing.aliyuncs.com/branch/community/cu121
CUDA 12.2
python3 -m pip install --pre oneflow -f https://oneflow-pro.oss-cn-beijing.aliyuncs.com/branch/community/cu122
- Install torch and diffusers
python3 -m pip install "torch" "transformers==4.27.1" "diffusers[torch]==0.19.3"
- Install OneDiff
git clone https://github.com/Oneflow-Inc/onediff.git
cd onediff && python3 -m pip install -e .
- (Optional)Login huggingface-cli
python3 -m pip install huggingface_hub
~/.local/bin/huggingface-cli login
docker pull oneflowinc/onediff:20231106