The Stable Difussion Project

iGPUs for AI

Stable Difussion

SelfHosting Stable Difussion Models with Docker and Automatic111.

Automatic111 with Docker

apt-get update && apt-get install -y \
  git \
  build-essential

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

cd stable-diffusion-webui
sudo apt install -y wget git python3 python3-venv libgl1 libglib2.0-0
version: '3'

services:
  sd-automatic:
    image: python:3.10.6-slim
    container_name: automatic
    command: tail -f /dev/null
    volumes:
      - ai_automatic:/app
    working_dir: /app  # Set the working directory to /app
    ports:
      - "7865:7865"

volumes:
  ai_automatic:
apt install -y wget git python3 python3-venv libgl1 libglib2.0-0 
apt install -y nano

wget -q https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh
#chmod +x webui.sh ## Make the script executable by all users
nano webui.sh

Comment these lines:

# Do not run as root
# if [[ $(id -u) -eq 0 && can_run_as_root -eq 0 ]]
# then
#     printf "\n%s\n" "${delimiter}"
#     printf "\e[1m\e[31mERROR: This script must not be launched as root, aborting...\e[0m"
#     printf "\n%s\n" "${delimiter}"
#     exit 1
# else
# printf "\n%s\n" "${delimiter}"
# printf "Running on \e[1m\e[32m%s\e[0m user" "$(whoami)"
# printf "\n%s\n" "${delimiter}"
# fi

Then just run:


./webui.sh

#sudo ./webui.sh
#sudo chown root:root webui.sh
pip install -r requirements.txt
#download model - see how the webui.sh does it
python3 webui.py --use-cpu --all

Ray Tracing: Imagine you’re playing a video game and you see reflections in water, shadows from trees, and light coming through windows. Ray tracing is a way to make these scenes look super realistic.

Integrated GPU (iGPU): An integrated GPU (Graphics Processing Unit) is like a small artist living inside your computer’s main brain (the CPU). Unlike a separate, big artist (a dedicated graphics card), this small artist shares the same space and resources with the main brain. This means that while it’s good for everyday tasks like watching videos, doing homework, or playing simple games, it’s not as powerful for heavy-duty tasks like playing big, graphics-heavy video games or doing 3D design. It’s like having a helper for graphics inside your computer without needing extra space or power. –>