Simple Stable Diffusion Telegram Bot. Spawns a Text2Image process via a local Automatic1111 WebUI API endpoint.
The bot forwards Telegram user input as a text prompt to the local API backend. When an image is done generating it is send back to the user. The bot also features a simple payment system and SQL database (SQLite3) to document jobs and basic user information. In addition, a simple Redis Queue handler was added to process multiple requests from different users in sequential order.
-
Clone repository
git clone https://github.com/ltillmann/stable-diffusion-telegram-bot
-
Install required dependencies.
pip3 install requirements.txt
-
Run a local instance of Automatic1111's WebUI stable-diffusion-webui (adapt prompt parameters and port if desired).
-
Start a Redis Server Redis.
-
Init your Bot on Telegram using BotFather and fill in your credentials in config file.
-
Run ./telegrambot.py script.
-
Use Bot. Type /start to begin.