Stable Diffusion : Install2025/10/02 |
|
Install [Stable Diffusion] that is the Text-to-Image model of deep learning. |
|
| [1] |
Install NVIDIA Graphic Driver for your Graphic Card, refer to here. |
| [2] |
The Python version of Debian 13 does not support PyTorch, which is used in Stable Diffusion, so we will start it using another Linux container. |
| [3] | Pull a container image that Stable Diffusion can run and install Stable Diffusion on it. |
|
root@dlp:~#
root@dlp:~# docker pull nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04
docker run --gpus all nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 /bin/bash -c \ "apt-get update; apt-get -y install python3.10 python3.10-venv python3-pip git curl libgl1-mesa-dev libglib2.0-0 libgoogle-perftools-dev; git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui; cd /stable-diffusion-webui; python3 launch.py --xformers --listen"
.....
.....
Installing requirements
Launching Web UI with arguments: --xformers --listen
Downloading: "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors" to /stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
100% 3.97G/3.97G [00:56<00:00, 75.5MB/s]
/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py:943: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
warnings.warn(
# once the above is displayed, cancel and stop the container
root@dlp:~# docker ps -a | head -2 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3539becfcf98 nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 "/opt/nvidia/nvidia_c" 7 minutes ago Exited (0) 8 seconds ago epic_kapitsaroot@dlp:~# docker commit 3539becfcf98 srv.world/stable-diffusion |
| [4] | Start Stable Diffusion Web. |
|
root@dlp:~# docker images REPOSITORY TAG IMAGE ID CREATED SIZE srv.world/stable-diffusion latest 1b2934990f68 12 seconds ago 17.3GB nvidia/cuda 12.4.1-cudnn-runtime-ubuntu22.04 a029a877f7e3 17 months ago 3.32GBroot@dlp:~# docker run --gpus all -dt -p 7860:7860 srv.world/stable-diffusion /bin/bash -c \ "cd /stable-diffusion-webui; python3 launch.py --xformers --listen" |
| [5] | Access to the port you set to container, then you can use [Stable Diffusion]. |
|
| [6] | Input any text and click [Generate] button, then image will be generated. The example below is [sugar glider wearing glasses]. |
|
|
|
|
|