This is a discord bot for use with AUTOMATIC1111's stable diffusion webui.
- Clone (or download and extract) this repository.
- Install node.js.
- Open a terminal in the cloned repo's folder and run
npm install
- Setup and download ngrok or forward port 3000.
- Download and setup AUTOMATIC1111's Stable Diffusion webui (installation instructions).
- Enable the webui API. On Windows, add
set COMMANDLINE_ARGS=--api
towebui-user.bat
. On other systems, change#export COMMANDLINE_ARGS=""
toexport COMMANDLINE_ARGS="--api"
. - Create an app and bot in the Discord developer dashboard, and install it to your server (guide). The bot requires attach files and embed links permissions (on top of the basic permissions in the guide).
- Create a file in the bot's folder called
.env
and put the following inside it:
APP_ID=<YOUR_APP_ID>
GUILD_ID=<YOUR_GUILD_ID>
DISCORD_TOKEN=<YOUR_BOT_TOKEN>
PUBLIC_KEY=<YOUR_PUBLIC_KEY>
All of the information can be found in the Discord developer dashboard (details).
The following steps should be done in seperate terminals:
- Start the Stable Diffusion webui.
- Start the app by running the command
node app.js
in the bot's folder. - Start ngrok using the command
ngrok http 3000
and copy the link into the interactions endpoint URL in the developer dashboard. The changes should save successfully if the node server is running.
The bot should now be online and slash commands available in your server.