Skip to main content

StableDiffusion Service

📘 Chatbot with StableDiffusion Service for image generation for Your GPU Pod

Use this helper to install and run a Chatbot+StableDiffusion inside your GPU pod.
You can then expose it via the Service Exposure feature.

📥 Download the Installer

bash
wget https://assets.hosted.ai/scripts/PodScripts/sdopenwebui/sd_manager.sh && chmod +x sd_manager.sh

🆘 Command Help

bash
./sd_manager.sh help
bash
 StableDiffusion + OpenWebUI wrapper

Usage:
  ./sd_manager.sh help          Show this help
  ./sd_manager.sh install       Download and install backend + OpenWebUI
  ./sd_manager.sh start         Start backend + OpenWebUI in background
  ./sd_manager.sh stop          Stop backend + OpenWebUI
  ./sd_manager.sh status        Show running status
  ./sd_manager.sh logs          Tail logs for both services
  ./sd_manager.sh restart       Restart both services

What it does:

- install:
    - Checks for python3, pip, python3-venv, wget.
    - If missing and apt-get is available, installs them automatically.
    - Downloads sdopenwebui.tgz from https://example.com/sdopenwebui.tgz
    - Extracts into: /home/ubuntu/sdopenwebui
    - Creates two virtualenvs:
        - Backend: /home/ubuntu/sdopenwebui/backend/.venv
        - OpenWebUI: /home/ubuntu/sdopenwebui/.venv-openwebui
    - Installs Python dependencies for backend + OpenWebUI
    - Leaves you with a .env file at /home/ubuntu/sdopenwebui/.env
      (edit HF_TOKEN and any other settings if needed)

- start:
    - Starts backend (StableDiffusion API) on port 8000
    - Starts OpenWebUI on port 3000
    - Logs:
        - Backend: /home/ubuntu/sdopenwebui/backend.log
        - OpenWebUI: /home/ubuntu/sdopenwebui/openwebui.log
    - PID files:
        - Backend: /home/ubuntu/sdopenwebui/backend.pid
        - OpenWebUI: /home/ubuntu/sdopenwebui/openwebui.pid

▶️ Install the packages & requirements

All the required system and python packages are installed. The chatbot service files are downloaded and ready to be deployed.

bash
./sd_manager.sh install

▶️ Start the chatbot service

Start the chatbot service including downloading the model

bash
./sd_manager.sh start

📝 Example Output (Explained)

When you start the service, you may see output similar to this:

bash
[INFO]  Starting backend (StableDiffusion API)...
[INFO]  Backend started with PID 2079, log: /home/ubuntu/sdopenwebui/backend.log
[INFO]  Starting OpenWebUI...
[INFO]  OpenWebUI started with PID 2082, log: /home/ubuntu/sdopenwebui/openwebui.log
[INFO]  Both services should now be running.
[INFO]  Open your browser at: http://localhost:3000

🌍 Enable External Access Through Service Exposure

⛔ Stop the StableDiffusion Service

bash
./sd_manager.sh stop

[INFO]  Stopping backend (PID 2079)...
[INFO]  Stopping OpenWebUI (PID 2082)...
[INFO]  Stop command issued. It may take a few seconds for processes to fully exit.

This safely shuts down both the chatbot and the API services.