sd-webui-discord

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

README

sd-webui-discord

SD-WEBUI-DISCORD

Support For Clustered Stable Diffusion WebUi Discord Bot

Mult-Language README

Introduction

SD-WEBUI-DISCORD is a Discord bot developed in Go language for stable-diffusion-webui. It utilizes the sd-webui-go to invoke the sd-webui API and supports cluster deployment of multiple sd-webui nodes with automatic scheduling and allocation. At the same time, there is also the sd-webui-discord-ex, which is an extension on the stable-diffusion-webui that you can install and use directly. It will automatically update every time you restart SD webui.

Screenshots

First

News

2023-09-24: Support multi image generate in txt2img command
2023-09-23:
  • Support Retry and Delete in txt2img command
2023-09-22:
  • Support setting_ui command
  • Better txt2img response ui,thanks for venetanji support that! #5
  • Optimize command add when bot start,thanks for venetanji support that! #5
2023-09-10: Support local language
2023-09-05: Support User Center on Windows
2023-09-04: Support Image to Image
2023-08-31: Support User Center
2023-08-27:
  • Support txt2img choice model checkpoint

  • Support upload image with attachment: deoldify png_info roop_image commands

    See Image

    example

2023-08-26: Support Setting default sd-webui options
2023-08-23: Support ControlNet for txt2img command
  • By using the controlnet_detect command to obtain the parameters of ControlNet and filling them into the controlnet_args parameter of the txt2img command, you can use ControlNet in txt2img.
2023-08-22: Support txt2img command
2023-08-22: Support roop command
2023-08-20: Support controlnet_detect command

Features

  • Local language support.
  • Global sd-webui default options.
  • Supports multi-node (sd-webui) deployment, distributed cluster queue with automatic scheduling.
  • User Center
    • Set user options with ui.
    • User Center can be freely enabled.
    • Customizable database types, currently supporting MySQL and SQLite.
    • Users can set their own default options. If not specified when generating images, the user's configured options will be used by default, such as image dimensions, cfg, steps, etc. For more details, please refer to the User Center (wiki).
    • Supports user registration.
  • ControlNet Preview
    • Supports specifying module and model through selection, eliminating the need for manual input.
    • Allows previewing preprocessing effects and obtaining args simultaneously (used for user-generated txt2img).
  • Text to Image
    • Support SDXL's refiner!
    • Supports user-defined default options from the User Center.
    • Enables specifying model, sampler, and other optional parameters through selection, eliminating the need for manual input.
    • Supports using parameters from "ControlNet Preview" directly.
  • Image to Image
    • Allows uploading images through an image control, rather than using URLs.
    • Supports all operations of img2img in sd-webui!
  • Roop Face Swap
    • Allows uploading images through an image control, rather than using URLs.
    • Supports specifying source and target through selection, eliminating the need for manual input.
    • Supports custom face rendering algorithms (GFPGAN, CodeFormer), as well as weights.
  • Deoldify Colorization
    • Allows uploading images through an image control, rather than using URLs.
    • Currently the best photo colorization model.
  • Segment-Anything
    • Allows uploading images through an image control, rather than using URLs.
    • Supports image segmentation based on natural language descriptions (DION+SAM).
    • Enables specifying DION and SAM models through selection, eliminating the need for manual input.
  • Background Removal
    • Allows uploading images through an image control, rather than using URLs.
    • Supports commonly used background removal algorithms.
    • Supports returning the mask.
  • Extra Single
    • Allows uploading images through an image control, rather than using URLs.
    • Supports facial repair.
    • Supports super-resolution, with models available for direct selection without manual input.
  • Png Info
    • Allows uploading images through an image control, rather than using URLs.
    • Supports retrieving parameters of images generated by sd-webui.

Usage

The command is still under active development, and there are two ways to experience sd-webui-discord:

  1. Join our Discord Server where you can try out the latest features and contribute by submitting issues and pull requests.
  2. Self-deploy it to have your own sd-webui-discord instance.
Discord Server

Discord

Installation

You need to install the following extensions on the SD webui:

sd-webui-segment-anything

sd-weubi-deoldify

stable-diffusion-webui-rembg

sd-webui-roop

sd-webui-controlnet


1.Download the latest release from here.

2.Create a bot account on Discord and get the token. How To Create Discord App.

3.Configuration and Startup

tar -zxvf sd-webui-discord-release-v*.tar.gz # unzip the release package

cd sd-webui-discord-release-v*/release/

Edit the config.json file and fill in the token and other information.

{
    "sd_webui":{
        "servers":[
            {
                "name":"webui-1",
                "host":"127.0.0.1:7860",
                "max_concurrent":5,
                "max_queue":100,
                "max_vram":"20G"
            }
        ]
    },
    "discord":{
        "token":"<your token here>",
        "server_id":"<your servers id here if empty all servers>"
    }
}

If you want set default value with sd-webui

{
    "sd_webui":{
        "servers":[...],
        "default_setting": {
            "cfg_scale": 8,
            "negative_prompt": "bad,text,watermask",
            "height":1024,
            "width":1024,
            "steps":32,
            "sampler":"Euler",
            "sd_model_checkpoint":"sd_xl_base_1.0.safetensors [31e35c80fc]"
        }
    }
    ...
}

If you want to enable the User Center

{
  ...
  "user_center":{
        "enable":false,
        "db_config":{
            "type":"sqlite", // support mysql and sqlite
            "dsn":"./user_center.db"
        }
  }
  ...
}

If you want disable return info in img2img and txt2img

{
  ...
  "disable_return_gen_info":true
  ...
}

Start The Bot

# if you can't connect discord,you need use proxy and run this command:
# export https_proxy=http://127.0.0.1:8888;export http_proxy=http://127.0.0.1:8888;
./sd-webui-discord

Participating

This is an ongoing project, and if you are interested in contributing, you can join our Discord Server. We welcome any feedback or suggestions, so feel free to submit an issue.

Documentation

Overview

* @Author: SpenserCai * @Date: 2023-08-15 21:55:36 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-30 01:21:25 * @Description: file content

Directories

Path Synopsis
api
* @Author: SpenserCai * @Date: 2023-09-29 15:37:14 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-06 17:22:12 * @Description: file content
* @Author: SpenserCai * @Date: 2023-09-29 15:37:14 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-06 17:22:12 * @Description: file content
business
* @Author: SpenserCai * @Date: 2023-09-30 12:53:43 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-03 16:45:54 * @Description: file content
* @Author: SpenserCai * @Date: 2023-09-30 12:53:43 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-03 16:45:54 * @Description: file content
gen/restapi
Package restapi ApiService
Package restapi ApiService
middleware
* @Author: SpenserCai * @Date: 2023-09-29 19:27:29 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-02 21:02:04 * @Description: file content
* @Author: SpenserCai * @Date: 2023-09-29 19:27:29 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-02 21:02:04 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-16 15:25:34 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-08-18 13:04:35 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-16 15:25:34 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-08-18 13:04:35 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-16 11:05:40 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-03 12:46:54 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-16 11:05:40 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-03 12:46:54 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-16 11:06:01 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-22 00:21:54 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-16 11:06:01 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-22 00:21:54 * @Description: file content
slash_handler
* @Author: SpenserCai * @Date: 2023-08-17 09:52:25 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-04 12:37:20 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-17 09:52:25 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-04 12:37:20 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-16 11:05:26 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-29 19:08:51 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-16 11:05:26 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-29 19:08:51 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-16 11:05:15 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-08-16 17:05:59 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-16 11:05:15 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-08-16 17:05:59 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-30 20:38:24 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-06 17:58:40 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-30 20:38:24 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-06 17:58:40 * @Description: file content
db
* @Author: SpenserCai * @Date: 2023-08-30 21:21:40 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-24 00:07:49 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-30 21:21:40 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-24 00:07:49 * @Description: file content
db/db_backend
* @Author: SpenserCai * @Date: 2023-08-31 00:44:10 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-04 12:38:53 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-31 00:44:10 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-10-04 12:38:53 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-17 00:40:47 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-24 00:43:58 * @Description: file content
* @Author: SpenserCai * @Date: 2023-08-17 00:40:47 * @version: * @LastEditors: SpenserCai * @LastEditTime: 2023-09-24 00:43:58 * @Description: file content

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL