{"id":13615081,"url":"https://github.com/huo-ju/dfserver","last_synced_at":"2025-10-06T02:54:58.467Z","repository":{"id":59367874,"uuid":"535467615","full_name":"huo-ju/dfserver","owner":"huo-ju","description":"A distributed backend AI pipeline server","archived":false,"fork":false,"pushed_at":"2023-02-21T06:55:47.000Z","size":3673,"stargazers_count":349,"open_issues_count":0,"forks_count":28,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-19T12:11:20.585Z","etag":null,"topics":["ai-art","ai-pipeline","diffusers","pipeline","stable-diffusion"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huo-ju.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-09-12T00:59:22.000Z","updated_at":"2025-05-19T02:22:01.000Z","dependencies_parsed_at":"2024-01-07T03:52:07.112Z","dependency_job_id":"b67d5848-37e2-4e22-a04e-94e3e7c2a337","html_url":"https://github.com/huo-ju/dfserver","commit_stats":{"total_commits":64,"total_committers":2,"mean_commits":32.0,"dds":0.046875,"last_synced_commit":"108f9d1eb7b8cd63ad9f4b7c2070ace6bd1411ea"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/huo-ju/dfserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huo-ju%2Fdfserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huo-ju%2Fdfserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huo-ju%2Fdfserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huo-ju%2Fdfserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huo-ju","download_url":"https://codeload.github.com/huo-ju/dfserver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huo-ju%2Fdfserver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278551490,"owners_count":26005389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-art","ai-pipeline","diffusers","pipeline","stable-diffusion"],"created_at":"2024-08-01T20:01:09.130Z","updated_at":"2025-10-06T02:54:58.448Z","avatar_url":"https://github.com/huo-ju.png","language":"Go","readme":"# dfserver\n\nDFserver is an open-sourced distributed backend AI pipeline server for building self-hosted distributed GPU cluster to run the [Stable Diffusion](https://stability.ai/blog/stable-diffusion-public-release) and various AI image or prompt building model, but also has a potential to expend large-scale production service, and etc.\n\nGive us a star and your valuable feedback :)\n\n***news***\n\nTry Stable Diffusion 2 experimental worker: [SD2.md](SD2.md)\n\n\nhttps://user-images.githubusercontent.com/561810/199627149-a8e0716d-3200-41ee-9fe6-77ff870431af.mp4\n\n\nThe 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).\n\nI 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, etc.\n\nWill soon support the generation of multiple images with a single command, and functions related to init-image.\n\n## Tasks currently supported in DFserver Pipeline server\n\n- AI image generator: Stable Diffusion 1.4 (with negative prompt) and Waifu Diffusion 1.3 \n- Image Upscaling (Default realesrgan-x4plus model)\n- Guess prompt from an image (CLIP Interrogator)\n- Prompt Build Assist (finetuned from a GPT Neo2.7B model by using 200K prompts selected and preprocessed from krea-ai open-prompts. Model download: [https://huggingface.co/huoju/gptneoforsdprompt](https://huggingface.co/huoju/gptneoforsdprompt))\n\n\n\u003cimg src=\"https://raw.githubusercontent.com/huo-ju/dfserver/main/public/images/demo1.png\" alt=\"demoimg1\" width=\"400\"/\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/huo-ju/dfserver/main/public/images/demo2.png\" alt=\"demoimg2\" width=\"400\"/\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/huo-ju/dfserver/main/public/images/prompt_builder.png\" alt=\"prompt builder\" width=\"800\"/\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/huo-ju/dfserver/main/public/images/waifu.png\" alt=\"waifu\" width=\"400\"/\u003e\n\n# System Topology\n\n![](public/images/topology.png)\n\n# Architecture\n\n![](public/images/architecture.png)\n\n# Task Sequence Diagram\n\n![](public/images/sequence.png)\n\n# Getting Start\n\n### Server Prerequisites\n\n- [RabbitMQ](https://www.rabbitmq.com/)\n- [discord developer](https://discord.com/developers/docs/intro#bots-and-apps) account and a discord bot token\n\n### Worker Prerequisites\n\n- A group of friends who have fancy GPUs 🤪\n- [pytorch](https://github.com/pytorch/pytorch)\n- [diffusers](https://github.com/huggingface/diffusers) and [models](https://huggingface.co/CompVis/stable-diffusion-v1-4)\n\n### Build the dfserver\n\nRequirements:\n\n- [Go 1.18 or newer](https://golang.org/dl/)\n\n```bash\n$ git clone \"https://github.com/huo-ju/dfserver.git\"\n$ cd dfserver\n$ make linux-amd64 #or make linux-arm64\n```\n\n### dfserver Configuration\n\n```bash\ncp configs/config.toml.sample configs/config.toml\n```\n\nEdit the config.toml, setup the username/password/host address/port of the rabbitmq.\n\nThe 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)\n\n### Run dfserver\n\n```bash\n./dist/linux_amd64/dfserver --confpath=./configs\n```\n\nor via docker-compose (so you don't need to install RabbitMQ particularly):\n```bash\ndocker compose up -d\n```\nPS: You still need to set a user in RabbitMQ for ai worker after docker-compose starting up.\n\n### AI Worker Install \n\nCopy the `pyworker` dir to the GPU server, and install all diffusers dependencies(nvidia drivers, CUDA, pytorch, models etc...).\n\n```bash\ncd pyworker\npip install -r requirements.txt\n```\n\n### AI Worker Configuration\n\n```bash\ncp configs/sd14mega_config.ini.sample configs/sd14mega_config.ini \n#or\ncp configs/realesrgan_config.ini.sample configs/realesrgan_config.ini\n#or\ncp configs/clipinterrogator_config.ini.sample configs/clipinterrogator_config.ini\n```\n\nEdit the config.ini, setup the username/password/host address/port of the rabbitmq.\n\n### Run the ai worker\n```bash\npython worker.py sd14mega #stable-diffusion worker with community SD Mega pipeline\n#or\npython worker.py realesrgan #realesrgan upscaling worker\n#or\npython worker.py clipinterrogator # clip-interrogator worker\n```\n\n### Usage\n\nAdd the discord bot to your disord server, and input your prompt.\n\nExample:\n\n`!dream Cute sticker design of a AI image generator robotic pipeline service, app icon, trending on appstore, trending on pixiv, hyper-detailed, sharp`\n\nwith negative prompt (diffuser \u003e= v0.4.0): \n\n`!dream Bouquet of Roses |red rose :-1|`\n\nThe 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). \n\nThe result (generated images) will be published back to the rabbitmq, fetched by process worker (discord.server1), and sent back to the user.\n\nRun the dfserver and aiworker on boot, please see the systemd scripts in `deployments`\n\n# TODO\n\n* ✔️  Response error messages to users\n* ✔️  More AI workers, eg: upscale worker \n* [] Multi GPUs worker support\n* ✔️  Initial image\n* [] Mask/Inpaint\n\n# Credits\n\n- [stability.ai](https://stability.ai/)\n- [pharmapsychotic](https://github.com/pharmapsychotic/clip-interrogator) for clip-interrogator\n- @[catmus](https://twitter.com/recatm)\n","funding_links":[],"categories":["Training","Go"],"sub_categories":["Task Chaining"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuo-ju%2Fdfserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuo-ju%2Fdfserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuo-ju%2Fdfserver/lists"}