This is an old revision of the document!


Stable diffusion

Stable diffusion tests on the N100 Mini PC.

Environment

Debian bookworm
apt update
apt full-upgrade
apt install build-essential git mercurial
apt install google-perftools libgl1 libglib2.0-0
Python
apt install python3-full
update-alternatives --remove-all python
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
update-alternatives --config python
python -V
Python 3.11.2
Swap

The system has 16 GB RAM so make at least 24 GB swap space.

swapoff /var/swap
dd if=/dev/zero of=/var/swap bs=4M count=6144
mkswap /var/swap
echo "/var/swap none swap sw 0 0" >> /etc/fstab
swapon /var/swap

AUTOMATIC1111

Install
mkdir -p ~/src && cd ~/src
git clone --recursive https://github.com/AUTOMATIC1111/stable-diffusion-webuii
cd stable-diffusion-webui stable-diffusion-webui.automatic1111
echo 'export PYTORCH_TRACING_MODE=TORCHFX' >> webui-user.sh
echo 'export COMMANDLINE_ARGS="--skip-torch-cuda-test --precision full --no-half --listen"' >> webui-user.sh
Run
./webui.sh

OPENVINO

Install
mkdir -p ~/src && cd ~/src
git clone --recursive https://github.com/openvinotoolkit/stable-diffusion-webui stable-diffusion-webui.openvino
cd stable-diffusion-webui
wget "https://raw.githubusercontent.com/openvinotoolkit/stable-diffusion-webui/refs/heads/master/scripts/openvino_accelerate.py" -O scripts/openvino_accelerate.py
Patch
diff -u requirements.txt.bak requirements.txt
--- requirements.txt.bak        2024-12-08 10:05:07.531033313 +0000
+++ requirements.txt    2024-12-08 10:21:51.939748587 +0000
@@ -28,7 +28,8 @@
 scikit-image>=0.19
 timm
 tomesd
-torch
+torch==2.1.0
+torchvision==0.16.0
 torchdiffeq
 torchsde
 diffusers
diff -u webui-user.sh.orig webui-user.sh
--- webui-user.sh.orig  2024-12-08 00:47:06.593715977 +0000
+++ webui-user.sh       2024-12-08 09:59:09.850730395 +0000
@@ -9,8 +9,11 @@
 # Name of the subdirectory
 #clone_dir="stable-diffusion-webui"

+export PYTORCH_TRACING_MODE=TORCHFX
+export USE_OPENVINO=1
+
 # Commandline arguments for webui.py, for example: export COMMANDLINE_ARGS="--medvram --opt-split-attention"
-#export COMMANDLINE_ARGS=""
+export COMMANDLINE_ARGS="--skip-torch-cuda-test --precision full --no-half --listen"

 # python3 executable
 #python_cmd="python3"
Run
./webui.sh

SD.Next

Install
mkdir -p ~/src && cd ~/src
git clone --recursive https://github.com/vladmandic/automatic automatic.sd.next
cd automatic
Run

The process gets killed with OOM even with 16 GB RAM and 24 GB swap space performing any operation.

./webui.sh --debug --use-openvino --listen --device-id 0

WEBUI

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies