Skip to content

Generate Images From A Text Prompt Using Various Stable Diffusion Models

License

Notifications You must be signed in to change notification settings

itskdhere/Stable-Diffusion-Discord-Bot

Repository files navigation

Stable Diffusion Discord Bot


CodeQL OSSAR

Discord

Generate Images From A Text Prompt Using Various Stable Diffusion Models Right Inside Discord Chat 😀

Only Host The Bot, No Need Self-Host Any Resource Consuming Models 😉

📰 Available Models:

  • (4 Images) Stable Diffusion v1.4
  • (4 Images) Stable Diffusion v2.1
  • (1 Image) Stable Diffusion v1.4
  • (1 Image) Stable Diffusion v2.0
  • (1 Image) Stable Diffusion v2.1
  • (1 Image) Stable Diffusion v2.1 Base

🌠 Slash Commands:

  • /imagine - Generate Image From Text Prompt

    • prompt - Text Prompt
    • negative_prompt - Negative Text Prompt
  • /settings - View or Change Settings

    • model - Select Default Model
    • guidance_scale - Set Default Guidance Scale
  • /ping - Check Websocket Heartbeat && Roundtrip Latency

  • /help - Show Help Message

🥏 Self-Hosting Guide:

You Can Either Use The Dockerized Setup Or Use Non-Dockerized Setup 🙃

🐳 Dockerized Setup:

🧾 Requirements:

  • Docker
  • Docker-Compose
  • Atleast 1vCPU , 0.5GB RAM & 1GB Storage For The Bot.
  • 📝 Steps:

    1. Create A Discord Bot:

    Create A Discord Bot From Discord Developer Portal. Keep The Client ID and Bot Token Handy. Add It To Your Server With Sample Invite URL Replacing BOT_CLIENT_ID With Bot's Client ID

    https://discord.com/api/oauth2/authorize?client_id=BOT_CLIENT_ID&permissions=414464724032&scope=applications.commands%20bot
    
    1. Clone This Repo:
    git clone https://github.com/itskdhere/Stable-Diffusion-Discord-Bot
    1. Create .env File In Root Directory:
    cp .env.example .env
    1. Fill .env File With Required Values:
    vim .env
    1. Build:
    docker build -t itskdhere/sd:1.1.3 .
    1. Start:
    docker run -d -p 7860:7860 --name sd itskdhere/sd:1.1.3

    Learn More About Docker Here & Docker-Compose Here

    1. Use The Bot 🎉

    🟢 Non-Dockerized Setup:

    🧾 Requirements:

  • Git
  • Node.js v20
  • Atleast 1vCPU , 0.5GB RAM & 1GB Storage For The Bot.
  • 📝 Steps:

    1. Create A Discord Bot:

    Create A Discord Bot From Discord Developer Portal. Keep The Client ID and Bot Token Handy. Add It To Your Server With Sample Invite URL Replacing BOT_CLIENT_ID With Bot's Client ID

    https://discord.com/api/oauth2/authorize?client_id=BOT_CLIENT_ID&permissions=414464724032&scope=applications.commands%20bot
    
    1. Clone This Repo:
    git clone https://github.com/itskdhere/Stable-Diffusion-Discord-Bot
    1. Navigate To The Repo Directory:
    cd Stable-Diffusion-Discord-Bot
    1. Install Dependencies:
    npm install
    1. Create .env File In Root Directory:
    cp .env.example .env
    1. Fill .env File With Required Variables:

    Use Your Favourite GUI Text Editor To Edit The File or If You've No Access To GUI Text Editor, Use Nano:

    nano .env
    1. Start The Bot:
    npm run start

    Or, If You Want To Run The Bot In Background:

    npm install pm2 -g
    npm run prod

    Learn More About PM2 Here

    1. Use The Bot 🎉

    💬 Support:

    ⛓ Others:

    🙂