How to use AUTOMATIC1111's Stable Diffusion web UI on Arch Linux

This information is deprecated. This page is archived for informational purposes.

Python on Arch Linux has been recently updated to 3.11, which will cause problems both during installation and when launching the web UI (such as getting stuck at "Installing requirements" and other issues with packages).

Note that this does NOT replace the official guide on how to install the web UI. Please refer to the official github page for the installation guide.

Setting up a conda environment with Python 3.10.6

Install python-conda and python-conda-package-handling from the AUR.

Restart your Terminal (important) and create and set-up a new conda environment with Python 3.10.6:

conda create -n sd python=3.10.6

Activate the new environment:

conda activate sd

Install prerequirements:

conda install libgcc

conda install -c conda-forge gcc=12.1.0

Install / reinstall the web UI

Make sure the conda environment is activated and proceed with install/reinstall. If you're reinstalling, delete the venv directory before proceeding.

Make sure to activate the conda environment before running the web UI.

Problems that can arise

xformers breaks everything

The following error appears when trying to use --xformers and even after removing the option:

RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=11.7 and torchvision has CUDA Version=11.8. Please reinstall the torchvision that matches your PyTorch install.

This happens because the launch.py script might install an outdated version of xformers that doesn't support latest torch and/or cu118, so it will be downgraded, leaving torchvision with a different version of CUDA, which will break everything.

Remove the outdated version of xformers:

./stable-diffusion-webui/venv/bin/python -m pip uninstall xformers

Reinstall the right versions of torch/torchvision:

./stable-diffusion-webui/venv/bin/python -m pip install torch==2.0.0+cu118 torchvision==0.15.1+cu118 --extra-index-url https://download.pytorch.org/whl/cu118

Install the updated version of xformers:

./stable-diffusion-webui/venv/bin/python -m pip install xformers==0.0.19

Now --xformers should work properly.