Giter Site home page Giter Site logo

camenduru / voltaml-fast-stable-diffusion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from voltaml/voltaml-fast-stable-diffusion

2.0 2.0 0.0 56.32 MB

Library to accelerate Stable-Diffusion models into fastest inference models ๐Ÿ”ฅ ๐Ÿ”ฅ

Home Page: https://voltaml.github.io/

License: Apache License 2.0

Shell 0.10% Python 66.89% CSS 2.76% HTML 29.76% Dockerfile 0.48%

voltaml-fast-stable-diffusion's Introduction

๐Ÿ”ฅ ๐Ÿ”ฅ voltaML-fast-stable-diffusion webUI ๐Ÿ”ฅ ๐Ÿ”ฅ

Lightweight library to accelerate Stable-Diffusion, Dreambooth into fastest inference models with WebUI single click or single line of code.

Setup webUI

Screenshot from 2022-12-12 11-19-09

Screenshot from 2022-12-12 11-36-37

Docker setup (if required)

Setup docker on Ubuntu using these intructions.

Setup docker on Windows using these intructions

Launch voltaML container

Download the docker-compose.yml file from this repo.

โš ๏ธ Linux: Open it in a text editor and change the path of the output folder. It was configured for Windows only.

output:
  driver: local
  driver_opts:
    type: none
    device: C:\voltaml\output # this line
    o: bind

Then, open a terminal in that folder and run the following command

Linux

sudo docker-compose up

Windows

docker-compose up

How to use webUI

  1. Once you launch the container, a flask app will run and copy/paste the url to run the webUI on your local host. Screenshot from 2022-12-12 12-36-01

  2. There are two backends to run the SD on, PyTorch and TensorRT (fastest version by NVIDIA).

  3. To run on PyTorch inference, you have to select the model, the model will be downloaded (which will take a few mins) into the container and the inference will be displayed. Downloaded models will be shown as below download_sd

  4. To run TensoRT inference, go to the Accelerate tab, pick a model from our model hub and click on the accelerate button.
    Screenshot from 2022-12-12 13-17-23

  5. Once acceleration is done, the model will show up in your TensorRT drop down menu.

  6. Switch your backend to TensorRT, select the model and enjoy the fastest outputs ๐Ÿš€๐Ÿš€

Benchmark

The below benchmarks have been done for generating a 512x512 image, batch size 1 for 50 iterations.

Model T4 (it/s) A10 (it/s) A100 (it/s) 4090 (it/s) 3090 (it/s) 2080Ti (it/s)
PyTorch 4.3 8.8 15.1 19 11 8
Flash attention xformers 5.5 15.6 27.5 28 15.7 N/A
AITemplate Not supported 26.7 55 60 N/A Not supported
VoltaML(TRT-Flash) 11.4 29.2 62.8 85 44.7 26.2

โš ๏ธ โ€ผ๏ธ Warnings/Caveats

This is v0.1 of the product. Things might break. A lot of improvements are on the way, so please bear with us.

  1. This will only work for NVIDIA GPUs with compute capability > 7.5.
  2. Cards with less than 12GB VRAM will have issues with acceleration, due to high memory required for the conversions. We're working on resolving these in our next release.
  3. While the model is accelerating, no other functionality will work since the GPU will be fully occupied

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.