Skip to content

OneDiff: An out-of-the-box acceleration library for diffusion models.

Notifications You must be signed in to change notification settings

camenduru/onediff

 
 

Repository files navigation

PyPI version Docker image build Run examples

OneDiff

An out-of-the-box acceleration library for diffusion models (especially for ComfyUI, HF diffusers, and Stable Diffusion web UI).

State-of-the-art performance

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.

Easy to use

Need help or talk

Business inquiry on OneDiff Enterprise Edition

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

Install from source or Using in Docker

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 from source

  1. 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.1
python3 -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
  1. Install torch and diffusers
python3 -m pip install "torch" "transformers==4.27.1" "diffusers[torch]==0.19.3"
  1. Install OneDiff
git clone https://github.com/Oneflow-Inc/onediff.git
cd onediff && python3 -m pip install -e .
  1. (Optional)Login huggingface-cli
python3 -m pip install huggingface_hub
 ~/.local/bin/huggingface-cli login

Docker

docker pull oneflowinc/onediff:20231106

About

OneDiff: An out-of-the-box acceleration library for diffusion models.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.1%
  • Other 0.9%