Skip to content

kopyl/oneflow-diffusers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

102 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPI version Docker image build

OneFlow diffusers

OneFlow backend support for diffusers

Performance

Updated on Nov 6, 2023.

SD1.5 (512x512) SD2.1 (512x512) SDXL1.0-base(1024x1024)
3090 42.38it/s 42.33it/s 6.66it/s
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

Run it by yourself using Docker:

docker pull oneflowinc/onediff:20231106

OneDiff Pro delivers even higher performance and second-to-none deployment flexibility.

Business inquiry

If you need LoRA, ComfyUI or quant support or any other more advanced features, please send an email to caishenghang@oneflow.org to tell us about your use case, deployment scale and requirements!!

  OneDiff Open Source OneDiff Pro
diffusers API Yes Yes
UNet/VAE Compilation Yes Yes
LoRA Yes
ComfyUI   Yes
Quantization   Yes
Source Code Access   Yes
Multiple Resolutions Limited Yes
Technical Support Community Yes

Use within docker or install with pip

Please refer to this wiki

Install from source

Clone and install

python3 -m pip install --pre oneflow -f https://oneflow-pro.oss-cn-beijing.aliyuncs.com/branch/master_open_source/cu118
python3 -m pip install "torch" "transformers==4.27.1" "diffusers[torch]==0.19.3"
git clone https://github.com/Oneflow-Inc/diffusers.git onediff
cd onediff && python3 -m pip install -e .

Other optional packages

CUDA 12.1

python3 -m pip install --pre oneflow -f https://oneflow-pro.oss-cn-beijing.aliyuncs.com/branch/master_open_source/cu121

CUDA 12.2

python3 -m pip install --pre oneflow -f https://oneflow-pro.oss-cn-beijing.aliyuncs.com/branch/master_open_source/cu122

Login huggingface-cli

python3 -m pip install huggingface_hub
 ~/.local/bin/huggingface-cli login

Run examples

python3 examples/text_to_image.py

Release

  • run examples to check it works

    python3 examples/text_to_image.py --model_id=...
    python3 examples/text_to_image_sdxl.py --base ...
    bash examples/unet_save_and_load.sh --model_id=...
  • bump version in these files:

    setup.py
    src/onediff/__init__.py
    
  • build wheel

    rm -rf dist
    python3 setup.py bdist_wheel
    
  • upload to pypi

    twine upload dist/*

More about OneFlow

OneFlow's main repo

About

OneFlow backend for 🤗 Diffusers and ComfyUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 99.5%
  • Dockerfile 0.5%