This is an AI image generator Discord bot written in Python. It has a chatbot that uses ChatGPT!
This project uses lots of APIs. As a result, you will not need a powerful computer!
DISCLAIMER: ChatGPT uses your Poe account. I am not responsible if your Poe account gets banned, since using Poe in programs is against their TOS.
- Using text-davinci-003 as the chatbot model
- Using Imaginepy
- ChatGPT chatbot that is integrated with Imaginepy
- 3 slash commands for generating images
- Stable Diffusion
- Anything Diffusion
- Pollinations
- ChatGPT is the fastest model that you can use.
- While generating a response with GPT4All, the program locks up.
- Do not input any personal information on the
/imagine_poly
command because your generated image will be displayed on their official frontpage. - Please do not enter any personal information in the Chatbot or in the image generators, because your prompts are sent to various providers.
- When you use Stable Horde to generate images, your prompts are sent to Stable Horde, as listed in their privacy policy.
- The chatbot may not work as expected if multiple users are chatting with it at once.
- When using Replit, GPT4All cannot be used.
- When using Replit, you must input your .env variables in the
Secrets
button on Replit.
This project assumes that:
- Python 3.8+ is installed and is on your PATH
- Pip is installed
- Python-venv is installed (only for Debian based distros)
- Git is installed
- You know how to create a Discord Bot account
- You know JSON syntax (It's basically a Python Dictionary)
- Create a Discord Bot and grab the token. Make sure to switch on Message Content Intent in the
Bot
tab of the Developer Portal. - Grab an API key from Stable Horde at their register page.
- Rename
example.env
to.env
and place your bot token and your API key in underAPI_KEY
. - Register for Poe and open inspect tool. Find your token and place it under
POE_TOKEN
in your.env
file. - Place your Discord bot token under
BOT_TOKEN
. - Clone the Stable Horde module:
git clone https://github.com/mak448a/horde_module --depth=1
- Create venv and install dependencies:
Linux or MacOS
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Windows
python -m venv venv
venv\Scripts\activate.bat
pip install -r requirements.txt
- Rename
example_config.json
toconfig.json
. Edit this file however you like. See Configuration. - Run the bot and invite it with the link it provides.
- Type / in the message box and try out the commands!
- You can chat with the bot by @pinging the bot and typing your message.
Configuring chat model
Go toconfig.json
and set the key "model"
to the model you want.
Available Models
- ChatGPT
- GPT4All
- text-davinci-003
You must write the model exactly as it is written here. When using ChatGPT, you must sign up for a Poe account.
When you are done, the edited line should look like this:
"model": "ChatGPT",
Disable chatbot
Go toconfig.json
and set the key "chatbot"
to false.
It should look like this:
"chatbot": false,
Change loading GIF
Go toconfig.json
and set the key "loading_gif"
to any GIF on Tenor you want!
It should look like this:
"loading_gif": "https://tenor.com/your/favorite/loading/gif",
Turn off command syncing (makes bot load faster)
Go toconfig.json
and set the key "sync"
to false
.
It should look like this:
"sync": false
Stable Horde uses Kudos to rank users on a queue. The more Kudos you have, the higher you are on the generation queue. You get Kudos by rating images and/or generating images for Stable Horde on your local hardware. To get more Kudos, first stick your api key here. Then, rate some images generated by other users here. After rating for a few minutes, you will have more Kudos! IMPORTANT: When an image says, "This rating must be x," you must rate it that. This picture is used as a Captcha to avoid spam.