GithubHelp home page GithubHelp logo

sumandeng / dfserver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from huo-ju/dfserver

0.0 1.0 0.0 833 KB

A distributed backend AI pipeline server

License: MIT License

Python 39.29% Go 60.11% Makefile 0.59%

dfserver's Introduction

dfserver

DFserver is an open-sourced distributed backend AI pipeline server for building self-hosted distributed GPU cluster to run the Stable Diffusion model, but also has a potential to expend to general AI image or prompt generative models, large-scale production service, and etc.

Give us a star and your valuable feedback :)

The service can uses idle fancy GPUs shared by your friends to build a GPU cluster for running various AI models or just be deployed on your own computer. In the future we will support counting and distributing possible revenue based on the workload of each GPU (Worker).

I have a beautiful vision for DFserver, which can be an enterprise-level service application that can flexibly extend the pipeline to connect models for different tasks in the AI image generation workflow, such as DeepL for supporting multi language prompt input, or Gobig by DD for filling more rendering details while upscale, or even prompt building targeted fine-tune GPT model.

Will soon support the generation of multiple images with a single command, and functions related to init-image.

System Topology

Task Sequence Diagram

Getting Start

Server Prerequisites

Worker Prerequisites

Build the dfserver

Requirements:

$ git clone "https://github.com/huo-ju/dfserver.git"
$ cd dfserver
$ make linux-amd64 #or make linux-arm64

dfserver Configuration

cp configs/config.toml.sample configs/config.toml

Edit the config.toml, setup the username/password/host address/port of the rabbitmq.

The default configuration was defined ONE task queue for stable diffusion ai worker (name is ai.sd14), ONE discord bot service, ONE process worker for discord(name is discord.server1)

Run dfserver

./dist/linux_amd64/dfserver --confpath=./configs

AI Worker Install

Copy the pyworker dir to the GPU server, and install all diffusers dependencies(nvidia drivers, CUDA, pytorch, models etc...).

cd pyworker
pip install -r requirements.txt
git clone https://github.com/huggingface/diffusers.git

AI Worker Configuration

cp configs/config.ini.sample configs/sd14_config.ini 
#or
cp configs/config.ini.sample configs/realesrgan_config.ini
#or
cp configs/config.ini.sample configs/clipinterrogator_config.ini

Edit the config.ini, setup the username/password/host address/port of the rabbitmq.

Run the ai worker

python worker.py sd14 #stable-diffusion worker
#or
python worker.py realesrgan #realesrgan upscaling worker
#or
python worker.py clipinterrogator # clip-interrogator worker

Useage

Add the discord bot to your disord server, and input your prompt.

For example:

!dream Cute sticker design of a AI image generator robotic pipeline service, app icon, trending on appstore, trending on pixiv, hyper-detailed, sharp

The ai task will be collected from user input by discord bot, and published to the rabbitmq, then the task will be fetched by ai worker (running on GPU servers).

The result (generated images) will be published back to the rabbitmq, fetched by process worker (discord.server1), and sent back to the user.

Run the dfserver and aiworker on boot, please see the systemd scripts in deployments

TODO

  • [] Response error messages to users
  • โœ”๏ธ More AI workers, eg: upscale worker
  • [] Multi GPUs worker support
  • [] Initial image
  • [] Mask/Inpaint

Credits

dfserver's People

Contributors

huo-ju avatar

Watchers

 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.