Giter Site home page Giter Site logo

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

View Code? Open in Web Editor NEW

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

0.0 0.0 0.0 3.26 MB

Lightweight library to accelerate Stable-Diffusion, Dreambooth into fastest inference models with single line of code 🔥 🔥

License: Apache License 2.0

Shell 0.40% Python 98.70% Dockerfile 0.89%

voltaml-fast-stable-diffusion's Introduction

Screenshot from 2022-11-22 15-29-39

⚡voltaML-fast-stable-diffusion 🔥 🔥

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

🔥Accelerate Computer vision, NLP models etc. with voltaML. Upto 10X speed up in inference🔥

Installation

voltaML Docker Container 🐳

git clone https://github.com/VoltaML/voltaML-fast-stable-diffusion.git
cd voltaML-fast-stable-diffusion

sudo docker pull voltaml/volta_diffusion:v0.2 

sudo docker run -it --gpus all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 -v $(pwd):/code --rm voltaml/volta_diffusion:v0.2 

Own setup:

Requirements: Please refer to the requirements.txt file to set it up on your own environment.

It is recommended to use our voltaml/volta_diffusion container or NVIDIA TensorRT container

Usage

Hugging Face Login

Login into your Hugging Face account through the terminal

huggingface-cli login
Token: #enter your huggingface token

Accelerate

bash optimize.sh --model='runwayml/stable-diffusion-v1-5' # your model path/ hugging face name

Inference

For TensorRT

python3 volta_infer.py --backend='TRT' --prompt='a gigantic robotic bipedal dinosaur, highly detailed, photorealistic, digital painting, artstation, concept art, sharp focus, illustration, art by greg rutkowski and alphonse mucha'

For PyTorch

python3 volta_infer.py --backend='PT' --prompt='a gigantic robotic bipedal dinosaur, highly detailed, photorealistic, digital painting, artstation, concept art, sharp focus, illustration, art by greg rutkowski and alphonse mucha'

Benchmark

python3 volta_infer.py --backend='TRT' --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)
PyTorch 4.3 8.8 15.1
Flash attention xformers 5.5 15.6 27.5
VoltaML(TRT) 7.7 17.2 36.1

diffusion posts diffusion posts 1 diffusion posts 3 diffusion posts 4

To-Do:

  • Integrate Flash-attention
  • Integrate AITemplate
  • Try Flash-attention with TensorRT

Contribution:

We invite the open source community to contribute and help us better voltaML. Please check out our contribution guide

References

voltaml-fast-stable-diffusion's People

Contributors

eltociear avatar harishprabhala avatar kamalkraj avatar riteshgangnani10 avatar

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.