Sygil-Dev / stable-diffusion

GNU Affero General Public License v3.0
1.72k stars 148 forks source link

Added an option to send a notification using Telegram bot when generation is finished #290

Closed Fxvoid closed 2 years ago

Fxvoid commented 2 years ago

Did this little thing for my own convenience but thought it may prove useful to everybody. In order for it to work and be displayed in "Advanced" tab you need to have .env file in the scripts/ folder containing two variables NOTIFIERS_TELEGRAM_TOKEN= and NOTIFIERS_TELEGRAM_CHAT_ID=. The token is obtained by creating Telegram bot using BotFather, the chat_id is obtained by typing something to your bot and then going to https://api.telegram.org/bot<YourBOTToken>/getUpdates and it will be somewhere around "chat":{"id":1234567890. Once you save the .env file and restart the webui you should be able to see and check "Send Telegram notification" under the "Advanced" tab.