Giter VIP home page Giter VIP logo

sdwebui-api-manager's Introduction

Problem of stable diffusion webui

Stable diffusion webui provides a powerful tool for AI image generation. However, the webui api has some limitations:

  1. a blocking REST api call, which might take more than 30s to return the final value. Most gateways don't allow such long blocking time on api call.
  2. webui api is a single thread process. Once the thread is occupied, other webui api will fail. (Even though there is a multi thread mode in stable diffusion webui)

This repo is aiming to solve the above problems.

Preconditions:

  • Python 3
  • Stable diffusion Webui

Inspired by the project

https://github.com/marciovrl/fastapi-example.git

Run local

Before run this project, please make sure you launched the stable diffusion webui api.

Install dependencies

pip install -r requirements.txt

Run server

uvicorn app.main:app --reload --port 5001

API documentation (provided by Swagger UI)

http://127.0.0.1:8000/docs

Model swtich

There is an extra filed in txt2img/img2img api:

options: Optional[dict]

You can swtich stable diffusion by using this options.

"options":
{
"sd_model_checkpoint": <The model you want to use>
}

sdwebui-api-manager's People

Contributors

marciovrl avatar nftblackmagic 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.