CentOS Stream 10

Stable Diffusion : Install2025/08/08

 

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 CentOS Stream 10 does not support PyTorch, which is used in Stable Diffusion, so we will start it using another Linux container.
Therefore, install the NVIDIA Container Toolkit, refer to here.

[3] Pull a container image that Stable Diffusion can run and install Stable Diffusion on it.
[root@dlp ~]#
docker pull nvidia/cuda:12.6.0-cudnn-runtime-ubuntu22.04
[root@dlp ~]#
docker run --gpus all nvidia/cuda:12.6.0-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
3ee0e7c97bba   nvidia/cuda:12.6.0-cudnn-runtime-ubuntu22.04   "/opt/nvidia/nvidia_�c"   7 minutes ago   Exited (0) 6 seconds ago             epic_pascal

[root@dlp ~]#
docker commit 3ee0e7c97bba srv.world/stable-diffusion

[4] Start Stable Diffusion Web.
[root@dlp ~]#
docker images

REPOSITORY                   TAG                                IMAGE ID       CREATED          SIZE
srv.world/stable-diffusion   latest                             3922a6c774c1   14 seconds ago   17.1GB
nvidia/cuda                  12.6.0-cudnn-runtime-ubuntu22.04   6a04f7fd0c08   12 months ago    3.18GB

[root@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].
Matched Content