# Rocky 8.7 & Stable diffusion v2

**URL:** <https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550>\
**Category:** Rocky Linux Help & Support\
**Created:** [January 13, 2023, 3:00pm UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550 "2023-01-13T15:00:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![chlowden](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@chlowden](https://forums.rockylinux.org/u/chlowden)\
**Post date:** [January 13, 2023, 3:00pm UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/1 "2023-01-13T15:00:10Z")

</div>

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.

```auto
[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

---

<div class="post-metadata">

**Author:** ![chemal](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/chemal/32/2238_2.png) [@chemal](https://forums.rockylinux.org/u/chemal)\
**Post date:** [January 13, 2023, 5:23pm UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/2 "2023-01-13T17:23:02Z")

</div>

Look at [https://download.pytorch.org/whl/cu113/torch/](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.

---

<div class="post-metadata">

**Author:** ![chlowden](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@chlowden](https://forums.rockylinux.org/u/chlowden)\
**Post date:** [January 13, 2023, 10:43pm UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/3 "2023-01-13T22:43:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![togaf](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/togaf/32/2602_2.png) [@togaf](https://forums.rockylinux.org/u/togaf)\
**Post date:** [January 16, 2023, 1:03am UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/4 "2023-01-16T01:03:13Z")

</div>

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.

> **[GitHub - AbdBarho/stable-diffusion-webui-docker: Easy Docker setup for Stable...](https://github.com/AbdBarho/stable-diffusion-webui-docker/)**
>
> Easy Docker setup for Stable Diffusion with user-friendly UI - GitHub - AbdBarho/stable-diffusion-webui-docker: Easy Docker setup for Stable Diffusion with user-friendly UI

---

<div class="post-metadata">

**Author:** ![chlowden](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@chlowden](https://forums.rockylinux.org/u/chlowden)\
**Post date:** [January 16, 2023, 11:53am UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/5 "2023-01-16T11:53:45Z")

</div>

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.

> **[Install Docker CE & Docker Compose on CentOS 8 | RHEL 8 | ComputingForGeeks](https://computingforgeeks.com/install-docker-and-docker-compose-on-rhel-8-centos-8/)**
>
> In this guide we'll be walking you through the steps of installing Docker CE on CentOS 8 | RHEL 8. We'll also cover how to install Docker Compose on RHEL 8 /

Once this done, your docker link installed properly.

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [January 16, 2023, 11:58am UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/6 "2023-01-16T11:58:08Z")

</div>

> [@chlowden](#):
>
> 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.

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

---

<div class="post-metadata">

**Author:** ![chlowden](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@chlowden](https://forums.rockylinux.org/u/chlowden)\
**Post date:** [January 16, 2023, 12:13pm UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/7 "2023-01-16T12:13:33Z")

</div>

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

```auto
$ 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'

```

---

<div class="post-metadata">

**Author:** ![togaf](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/togaf/32/2602_2.png) [@togaf](https://forums.rockylinux.org/u/togaf)\
**Post date:** [January 16, 2023, 3:06pm UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/8 "2023-01-16T15:06:09Z")

</div>

> [@jlehtone](#):
>
> RHEL has `podman`. The podman can use docker images from docker repos.

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 🙂.

---

<div class="post-metadata">

**Author:** ![chlowden](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@chlowden](https://forums.rockylinux.org/u/chlowden)\
**Post date:** [January 17, 2023, 9:43am UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/9 "2023-01-17T09:43:45Z")

</div>

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

```auto
docker compose --profile download up --build

```

but I cannot move forward due to an error

```auto
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

```auto
Docker Compose version v2.15.1

```

```auto
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.

---

<div class="post-metadata">

**Author:** ![chemal](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/chemal/32/2238_2.png) [@chemal](https://forums.rockylinux.org/u/chemal)\
**Post date:** [January 17, 2023, 10:59am UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/10 "2023-01-17T10:59:02Z")

</div>

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

```auto
$ 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:

```auto
--- 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:

```auto
$ bash webui.sh

```

---

<div class="post-metadata">

**Author:** ![chlowden](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@chlowden](https://forums.rockylinux.org/u/chlowden)\
**Post date:** [January 17, 2023, 12:39pm UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/11 "2023-01-17T12:39:37Z")

</div>

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 …

```auto
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?

---

<div class="post-metadata">

**Author:** ![chemal](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/chemal/32/2238_2.png) [@chemal](https://forums.rockylinux.org/u/chemal)\
**Post date:** [January 17, 2023, 7:54pm UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/12 "2023-01-17T19:54:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chlowden](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@chlowden](https://forums.rockylinux.org/u/chlowden)\
**Post date:** [January 17, 2023, 9:09pm UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/13 "2023-01-17T21:09:43Z")

</div>

I have removed the # to leave

```auto
export GIT="git"

```

But sadly I get the same torch error.

---

<div class="post-metadata">

**Author:** ![chlowden](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@chlowden](https://forums.rockylinux.org/u/chlowden)\
**Post date:** [January 17, 2023, 9:37pm UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/14 "2023-01-17T21:37:15Z")

</div>

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

> <https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/4299>
>
> \### Is there an existing issue for this?
> 
> \- \[X\] I have searched the existing iss…ues and checked the recent builds/commits
> 
> \### What happened?
> 
> Running web-ui.bat throws up this error:
> 
> venv "C:\\stable-diffusion-webui-master\\venv\\Scripts\\Python.exe"
> Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) \[MSC v.1932 64 bit (AMD64)\]
> Commit hash: \<none\>
> Installing torch and torchvision
> Traceback (most recent call last):
> File "C:\\stable-diffusion-webui-master\\launch.py", line 251, in \<module\>
> prepare\_enviroment()
> File "C:\\stable-diffusion-webui-master\\launch.py", line 169, in prepare\_enviroment
> run(f'"{python}" -m {torch\_command}', "Installing torch and torchvision", "Couldn't install torch")
> File "C:\\stable-diffusion-webui-master\\launch.py", line 34, in run
> raise RuntimeError(message)
> RuntimeError: Couldn't install torch.
> Command: "C:\\stable-diffusion-webui-master\\venv\\Scripts\\python.exe" -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: \<empty\>
> stderr: Traceback (most recent call last):
> File "C:\\Users\\Sparky\\AppData\\Local\\Programs\\Python\\Python310\\lib\\runpy.py", line 196, in \_run\_module\_as\_main
> return \_run\_code(code, main\_globals, None,
> File "C:\\Users\\Sparky\\AppData\\Local\\Programs\\Python\\Python310\\lib\\runpy.py", line 86, in \_run\_code
> exec(code, run\_globals)
> File "C:\\stable-diffusion-webui-master\\venv\\lib\\site-packages\\pip\\\_\_main\_\_.py", line 29, in \<module\>
> from pip.\_internal.cli.main import main as \_main
> File "C:\\stable-diffusion-webui-master\\venv\\lib\\site-packages\\pip\\\_internal\\\_\_init\_\_.py", line 3, in \<module\>
> import pip.\_internal.utils.inject\_securetransport # noqa
> ValueError: source code string cannot contain null bytes
> 
> I've tried uninstalling torch, manually installing it, removing it again, updating python to version 11, then downgrading it first to 10.8, then to 10.6.
> 
> \### Steps to reproduce the problem
> 
> 1. Go to root stable-diffusion-webui-master
> 2. Click webui-user.bat or webui.bat
> 3. Error Codes Ensue
> 
> 
> \### What should have happened?
> 
> It should have installed Torch and Torchvision and moved on to the next step.
> 
> \### Commit where the problem happens
> 
> It says \<none\>?
> 
> \### What platforms do you use to access UI ?
> 
> Windows
> 
> \### What browsers do you use to access the UI ?
> 
> Microsoft Edge
> 
> \### Command Line Arguments
> 
> \_No response\_
> 
> \### Additional information, context and logs
> 
> \_No response\_

---

<div class="post-metadata">

**Author:** ![chlowden](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@chlowden](https://forums.rockylinux.org/u/chlowden)\
**Post date:** [January 17, 2023, 10:10pm UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/15 "2023-01-17T22:10:15Z")

</div>

I followed this method to install python 3.10.6

> **[How to Install Python 3.10 on Rocky Linux](https://www.centlinux.com/2022/06/how-to-install-python-310-on-rocky-linux.html)**
>
> In this article, you will learn how to install Python 3.10 on Rocky Linux 8 or other RPM based distros.

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

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [January 17, 2023, 10:14pm UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/16 "2023-01-17T22:14:25Z")

</div>

> [@chlowden](#):
>
> Rocky repo offers 3.6

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

---

<div class="post-metadata">

**Author:** ![chlowden](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@chlowden](https://forums.rockylinux.org/u/chlowden)\
**Post date:** [January 18, 2023, 9:08am UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/17 "2023-01-18T09:08:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [January 18, 2023, 11:37am UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/18 "2023-01-18T11:37:05Z")

</div>

> [@chlowden](#):
>
> does not list as the system wide Python version therefore is not a solution for me.

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

---

<div class="post-metadata">

**Author:** ![chemal](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/chemal/32/2238_2.png) [@chemal](https://forums.rockylinux.org/u/chemal)\
**Post date:** [January 19, 2023, 9:35am UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/19 "2023-01-19T09:35:32Z")

</div>

> [@chlowden](#):
>
> I have removed the # to leave
> 
> ```auto
> export GIT="git"
> 
> ```
> 
> But sadly I get the same torch error.

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![chlowden](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@chlowden](https://forums.rockylinux.org/u/chlowden)\
**Post date:** [January 19, 2023, 8:30pm UTC](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550/20 "2023-01-19T20:30:40Z")

</div>

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.

> **[GitHub - AUTOMATIC1111/stable-diffusion-webui: Stable Diffusion web UI](https://github.com/AUTOMATIC1111/stable-diffusion-webui)**
>
> Stable Diffusion web UI. Contribute to AUTOMATIC1111/stable-diffusion-webui development by creating an account on GitHub.

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.

[Next page](https://forums.rockylinux.org/t/rocky-8-7-stable-diffusion-v2/8550.md?page=2)
