Rocky 8.7 & Stable diffusion v2

Hello
I was wondering if anyone has been able to get Stable Diffusion V2 running on a Rocky 8.7 machine?

I have been able to get Easy Diffusion
https://github.com/cmdr2/stable-diffusion-ui
running on my Rocky 8.7 machine, but this version is too basic for my needs, so I thought I could do the full SD install.

But I am getting stuck with a pip install issue. I have installed versions python 3, 3.6, 3.9 & 3.10 with resolving the issue of how to upgrade pip.

[admin@lowrocky ~]$ cd /home/admin/Downloads/SD/stable-diffusion/stable-diffusion-webui/
[admin@lowrocky stable-diffusion-webui]$ ./webui.sh 

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on admin user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Python 3.6.8 (default, Nov  8 2022, 11:32:15) 
[GCC 8.5.0 20210514 (Red Hat 8.5.0-15)]
Commit hash: 0b8911d883118daa54f7735c5b753b5575d9f943
Installing torch and torchvision
Traceback (most recent call last):
  File "launch.py", line 307, in <module>
    prepare_environment()
  File "launch.py", line 218, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch")
  File "launch.py", line 64, in run
    raise RuntimeError(message)
RuntimeError: Couldn't install torch.
Command: "/home/admin/Downloads/SD/stable-diffusion/stable-diffusion-webui/venv/bin/python3" -m pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
Error code: 1
stdout: Collecting torch==1.12.1+cu113

stderr:   Could not find a version that satisfies the requirement torch==1.12.1+cu113 (from versions: 1.0.0, 1.0.1, 1.0.1.post2, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.4.0, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.0+cu113, 1.10.1, 1.10.1+cu113, 1.10.2, 1.10.2+cu113)
No matching distribution found for torch==1.12.1+cu113
You are using pip version 9.0.3, however version 22.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

The above error seems to be a quite common for Windows but I cannot find much for linux.
Any thoughts are most welcom

Look at https://download.pytorch.org/whl/cu113/torch/. For torch-1.12.1+cu113, they only provide wheels for python 3.7+. You are using python 3.6.

Hello chemal,
Thank you for the reply.
I have tried to update the SD update you suggested as per the error but the error continues.
I am wondering why the standard diffusion install does not have the right the python and pytorch elements to function correctly. The Easy Diffusion install is completely autonomous.

I was successfully able to get SD running on Rocky 8.7 a couple months back. Any dependency issues were sidestepped by using Docker though. Can’t comment on your specific error.

Hello Togaf,
Thank you your suggestion.
I have discovered that installing docker on Rocky 8.7 is not the straight forward as RHEL does not seem to have an official docker install.
I eventually got a docker installation by following Centos 8 version in the link below.

Once this done, your docker link installed properly.

1 Like

RHEL has podman. The podman can use docker images from docker repos.

I could not get podman to work for the SD docker above… but I am no specialist.
I was getting this error

$ docker compose --profile download up --build
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: unknown flag: --profile
See 'podman --help'

Podman rules! I’ve had great success using it as a drop-in replacement for Docker for most applications.

Unfortunately for Stable-diffusion-webui-docker I just couldn’t figure out how to rework their instructions to be Podman-friendly, and had to go the Docker route.

Someone with more container management experience could likely get SD working on Podman, for sure :slightly_smiling_face:.

I have managed to get docker and docker compose installed but I cannot seem to get SD installed using

docker compose --profile download up --build

but I cannot move forward due to an error

unknown flag: --profile
See 'docker --help'.

the help confirms that profile is not there and I cannot find anything on the web to add this service.
I am using

Docker Compose version v2.15.1
Package docker-ce-3:20.10.22-3.el8.x86_64 is already installed.
Package docker-ce-cli-1:20.10.22-3.el8.x86_64 is already installed.
Package containerd.io-1.6.15-3.1.el8.x86_64 is already installed.

Any help would be most welcome.

You don’t need docker or podman at all. Just do something like this:

$ sudo dnf install python39
$ cd $HOME
$ git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
$ cd stable-diffusion-webui

Now edit the file webui-user.sh like this:

--- a/webui-user.sh
+++ b/webui-user.sh
@@ -13,7 +13,7 @@
 #export COMMANDLINE_ARGS=""
 
 # python3 executable
-#python_cmd="python3"
+python_cmd="python3.9"
 
 # git executable
 #export GIT="git"

And finally type:

$ bash webui.sh

Chemal
Thank you for the code above.
Far simpler than other web pages for the same github …
But each time I use this method, I get stuck with …

Python 3.6.8 (default, Nov  8 2022, 11:32:15) 
[GCC 8.5.0 20210514 (Red Hat 8.5.0-15)]
Commit hash: 38b7186e6e3a4dffc93225308b822f0dae43a47d
Installing torch and torchvision
Traceback (most recent call last):
  File "launch.py", line 316, in <module>
    prepare_environment()
  File "launch.py", line 225, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch")
  File "launch.py", line 65, in run
    raise RuntimeError(message)
RuntimeError: Couldn't install torch.
Command: "/home/admin/Downloads/stable-diffusion-webui/venv/bin/python3" -m pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
Error code: 1
stdout: Collecting torch==1.12.1+cu113

stderr:   Cache entry deserialization failed, entry ignored
  Could not find a version that satisfies the requirement torch==1.12.1+cu113 (from versions: 1.0.0, 1.0.1, 1.0.1.post2, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.4.0, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.0+cu113, 1.10.1, 1.10.1+cu113, 1.10.2, 1.10.2+cu113)
No matching distribution found for torch==1.12.1+cu113
You are using pip version 9.0.3, however version 22.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

I have spent hours installing, upgrading, uninstalling pip & torch without success. Do you have a magic bullet for this one please?

Did you remove the # from the line you had to edit?

I have removed the # to leave

export GIT="git"

But sadly I get the same torch error.

The issue might be that the Torch used for SD installs, only runs with Python 3.10.6 and Rocky repo offers 3.6.

I followed this method to install python 3.10.6

I threw away the SDwebui venv folder but the installer continues to try to install 3.6in SD.

Rocky should offer 3.8 and 3.9 as streams. See dnf module list
Alas, those are no 3.10.

The Python3.10.6 does install but does not list as the system wide Python version therefore is not a solution for me.
It looks like SD webgui is not Rocky compatible … but I am really hoping to be proved wrong.

Can’t you run your application / service in venv (that has the 3.10)?

The point isn’t GIT but python_cmd. That line should read

python_cmd=python3.9

And as long as your output from running webui.sh starts with Python 3.6.8 you didn’t get that right and it won’t work.

Another data point: Python 3.8 is good enough. I can install and run stable-diffusion-webui on CentOS 7 with RH’s rh-python38 SCL. I cannot do a full install on Rocky 8, because I have no machine with CUDA installed available. But I get torch and torchvision installed with the instructions given above (which you obviously didn’t follow) before the script detects that I don’t have CUDA and then aborts.

Chemal
Thank you for pointing out the detail. I will pursue on the “rocky” road to success.

In the meantime, I have managed to do a full SD Automatic111 webgui install with dreambooth on windows 10.

After many hours of failure, I was only ever able to do a complete install with python 3.10.6, following rigorously the what is written in the instructions.
There are so many web pages with approximate information, that I got lost down many rabbit holes.