Skip to content

A discord bot that allows to use Stable Diffusion with Midjourney-like feel

License

Notifications You must be signed in to change notification settings

Spaceginner/stable-reaction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stable Reaction

About

A discord bot that allows to use Stable Diffusion with Midjourney-like feel. Uses an API from AUTOMATIC1111's WebUI for interfering with Stable Diffusion

Community

Where to find

I live in Discord server

Contribution

if you want to help this project, go to its todo list and implement something from there, it would help a lot

How to use

It provides few commands for now:

  • /diffuse — txt2img inference

  • /settings — change settings on per-user bases

  • /ping — allows to ping a bot

And also provides buttons:

  • Cancle Job — equivalent to Interrupt button in the WebUI

  • S<N> — where <N> is the image number; provides unchanged generated image

  • U<N> — where <N> is the image number; upscales image with the user settings

  • Info — shows all information about the job

  • Regen — regenerates the request with the same parameteres, except for the seed

Installation

  1. Install AUTOMATIC1111's WebUI and launch it with --api flag

  2. Clone this repository in any* folder using this command:

git clone https://github.com/Spaceginner/stable-reaction

*In folders that don't require administrative privileges to create and edit files in them

  1. Create venv using following:
python -m venv venv
  1. Now, you have to activate venv, run this in Stable Reaction folder if you have Windows:
cd venv\Scripts\
.\activate
cd ..\..\

or this if you have anything else than Windows:

cd venv\bin\
.\activate
cd ..\..\
  1. Then install all dependencies by running this command:
pip install -r requirements.txt
  1. Go to Discord Developer Portal and create a new application

  2. Go to Bot tab and create a bot, then press Reset Token and copy a token DO NOT SHARE TOKEN WITH ANYBODY. Then open config.yaml with any text editor and put your token in token field.

  3. To invite a bot to your server, go to OAuth2 tab in Discord Developer Portal and then go to URL Generator, then select following scopes: bot, applications.commands and these permissions: Send Messages, Send Messages in Threads, Attach Files, Use Slash Commands. At the bottom you will have an invite link.

8.1. (Optional) You can change the bot icon in Application tab, just click upload an icon, the icon itself you can find in resources\icon\ folder, you are interested in final.png

  1. If you changed default URL in AUTOMATIC1111's WebUI,

  2. then open config.yaml and change webui_url field respectively.

  3. Launch this bot (make sure venv is still active):

python app.py
  1. To test it, issue this command in discord: /diffuse prompt:austronaut on a horse in space, Earth, concept art

Credits

Libraries

Used libraries: PIL (Pillow), PyCord, requests and PyYAML

Icon

Tool used: Pattern Collider

Bot icon's pattern: link

To convert from SVG to PNG ImageMagick was used with the following command:

convert .\original.svg -resize 1024x1024^ -gravity center -crop 1024x1024+0+0 +repage .\final.png

License

This project is licensed under GPL-3.0 license

About

A discord bot that allows to use Stable Diffusion with Midjourney-like feel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages