This repository allows you to run deep-floyd/IF or StableDiffusion XL as a basic Discord bot.
Use the /imagine command with a prompt like "an oil painting of a spiral galaxy"
to interact with the bot.
The following commands are supported:
/imagine prompt: <your_prompt_here>
/enhance prompt: <your_prompt_here> image_url: <image_url_here>
Both prompts support {template} syntax, e.g., a {photo, painting} of a {dog, cat}
generates 4 different prompts.
This defaults to DeepFloyd.
The setup instructions are provided below. If you encounter any issues, feel free to create an issue in this repository. For problems specifically related to step 1, it is recommended to seek help on the official DeepFloyd IF issues page.
-
Set up DeepFloyd IF at https://github.com/deep-floyd/IF until you can run the
Diffusers
example. This is the most challenging part. -
Clone this repository using
git clone https://github.com/sshh12/diffuser-discord-bot
. -
Install the required dependencies:
- Run
pip install -r requirements-bot.txt
to install Discord bot dependencies. - Run
pip install -r requirements-worker.txt
to install model dependencies.
- Run
-
Set up a Discord Bot. You can create one here.
-
Obtain an Imgur API key by creating an app here. You can use it anonymously.
-
Set up the following environment variables:
DISCORD_TOKEN= (your bot's secret token) SYNC_GUILD= (optional guild id of your server) IMGUR_CLIENT_ID= (your Imgur client id)
-
Run the bot using
python scripts/run_bot.py
. -
Create a bot invite link and invite the bot to your server.
This defaults to StableDiffusion XL.
-
Clone this repository using
git clone https://github.com/sshh12/diffuser-discord-bot
. -
Install the required dependencies:
- Run
pip install -r requirements-bot.txt
to install Discord bot dependencies.
- Run
-
Set up a Discord Bot. You can create one here.
-
Obtain an Imgur API key by creating an app here. You can use it anonymously.
-
Set up the following environment variables:
DISCORD_TOKEN= (your bot's secret token) SYNC_GUILD= (optional guild id of your server)
-
Start the https://modal.com/ app with
modal deploy diffuser_discord.ml_worker.modalapp
-
Run the bot using
python scripts/run_bot_with_modal.py
. -
Create a bot invite link and invite the bot to your server.