Giter Site home page Giter Site logo

rumadra / lsmith Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ddpn08/radiata

0.0 0.0 0.0 2.24 MB

StableDiffusionWebUI accelerated using TensorRT

License: Apache License 2.0

Shell 0.65% JavaScript 0.68% Python 57.79% TypeScript 39.80% HTML 0.19% Batchfile 0.90%

lsmith's Introduction

Lsmith is a fast StableDiffusionWebUI using high-speed inference technology with TensorRT


Benchmark

benchmark

Installation

Docker (All platform, Recommended) | Easy

  1. Clone repository
git clone https://github.com/ddPn08/Lsmith.git
cd Lsmith
git submodule update --init --recursive
  1. Launch using Docker compose
docker-compose up --build

Data such as models and output images are saved in the docker-data directory.

Customization

There are two types of Dockerfile.

Dockerfile.full Build the TensorRT plugin. The build can take tens of minutes.
Dockerfile.lite Download the pre-built TensorRT plugin from Github Releases. Build times are significantly reduced.

You can change the Dockerfile to use by changing the value of services.lsmith.build.dockerfile in docker-compose.yml. By default it uses Dockerfile.lite.

Linux | Difficult

requirements

  • node.js (recommended version is 18)
  • pnpm
  • python 3.10
  • pip
  • CUDA
  • cuDNN < 8.6.0
  • TensorRT 8.5.x
  1. Clone Lsmith repository
git clone https://github.com/ddPn08/Lsmith.git
cd Lsmith
git submodule update --init --recursive
  1. Enter the repository directory.
cd Lsmith
  1. Enter frontend directory and build frontend
cd frontend
pnpm i
pnpm build --out-dir ../dist
  1. Run launch.sh with the path to libnvinfer_plugin.so in the LD_PRELOAD variable.
ex.)
bash launch.sh --host 0.0.0.0

Windows | Difficult

requirements

  • node.js (recommended version is 18)
  • pnpm
  • python 3.10
  • pip
  • CUDA
  • cuDNN < 8.6.0
  • TensorRT 8.5.x
  1. Install nvidia gpu driver
  2. Instal cuda 11.x (Click here for the official guide)
  3. Instal cudnn 8.6.0 (Click here for the official guide)
  4. Install tensorrt 8.5.3.1 (Click here for the official guide)
  5. Clone Lsmith repository
git clone https://github.com/ddPn08/Lsmith.git
cd Lsmith
git submodule update --init --recursive
  1. Enter frontend directory and build frontend
cd frontend
pnpm i
pnpm build --out-dir ../dist
  1. Launch launch-user.bat

Usage

Once started, access <ip address>:<port number> (ex http://localhost:8000) to open the WebUI.

First of all, we need to convert our existing diffusers model to the tensorrt engine.

Building the TensorRT engine

  1. Click on the "engine" tab
  2. Enter Huggingface's Diffusers model ID in Model ID (ex: CompVis/stable-diffusion-v1-4)
  3. Enter your Huggingface access token in HuggingFace Access Token (required for some repositories). Access tokens can be obtained or created from this page.
  4. Click the Build button to start building the engine.
    • There may be some warnings during the engine build, but you can safely ignore them unless the build fails.
    • The build can take tens of minutes. For reference it takes an average of 15 minutes on the RTX3060 12GB.

Generate images

  1. Select the model in the header dropdown.
  2. Click on the "txt2img" tab
  3. Click "Generate" button.



Special thanks to the technical members of the AI絵作り研究会, a Japanese AI image generation community.

lsmith's People

Contributors

camenduru avatar ddpn08 avatar eltociear avatar fkunn1326 avatar hibikine avatar p1atdev 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.