lshqqytiger / stable-diffusion-webui-amdgpu

Stable Diffusion web UI
GNU Affero General Public License v3.0
1.87k stars 191 forks source link
ai ai-art amd amdgpu deep-learning directml hip image-generation image2image img2img radeon rocm stable-diffusion text2image torch txt2img web

Stable Diffusion web UI for AMDGPUs

A web interface for Stable Diffusion, implemented using Gradio library.

Features

Detailed feature showcase with images:

What's different from upstream repo?

DirectML support for every GPUs that support DirectX 12 API.

ZLUDA support for AMDGPUs.

Installation and Running

Using DirectML

DirectML is available for every gpu that supports DirectX 12.

If you are using one of recent AMDGPUs, ZLUDA is more recommended.

Start WebUI with --use-directml.

Using ZLUDA

Most of AMDGPUs are compatible.

Start WebUI with --use-zluda.

Visit detailed guide for details.

Installation on Windows 10/11 with NVidia-GPUs using release package

  1. Download sd.webui.zip from v1.0.0-pre and extract its contents.
  2. Run update.bat.
  3. Run run.bat.

    For more details see Install-and-Run-on-NVidia-GPUs

Automatic Installation on Windows

  1. Install Python 3.10.6 (Newer version of Python does not support torch), checking "Add Python to PATH".
  2. Install git.
  3. Download the stable-diffusion-webui-amdgpu repository, for example by running git clone https://github.com/lshqqytiger/stable-diffusion-webui-amdgpu.git.
  4. Run webui-user.bat from Windows Explorer as normal, non-administrator, user.

Automatic Installation on Linux

  1. Install the dependencies:
# Debian-based:
sudo apt install wget git python3 python3-venv libgl1 libglib2.0-0
# Red Hat-based:
sudo dnf install wget git python3 gperftools-libs libglvnd-glx
# openSUSE-based:
sudo zypper install wget git python3 libtcmalloc4 libglvnd
# Arch-based:
sudo pacman -S wget git python3

If your system is very new, you need to install python3.11 or python3.10:

# Ubuntu 24.04
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.11

# Manjaro/Arch
sudo pacman -S yay
yay -S python311 # do not confuse with python3.11 package

# Only for 3.11
# Then set up env variable in launch script
export python_cmd="python3.11"
# or in webui-user.sh
python_cmd="python3.11"
  1. Navigate to the directory you would like the webui to be installed and execute the following command:
wget -q https://raw.githubusercontent.com/lshqqytiger/stable-diffusion-webui-amdgpu/master/webui.sh

Or just clone the repo wherever you want:

git clone https://github.com/lshqqytiger/stable-diffusion-webui-amdgpu
  1. Run webui.sh.
  2. Check webui-user.sh for options.

Installation on Apple Silicon

Find the instructions here.

Contributing

Here's how to add code to this repo: Contributing

Documentation

The documentation was moved from this README over to the project's wiki.

For the purposes of getting Google and other search engines to crawl the wiki, here's a link to the (not for humans) crawlable wiki.

Credits

Licenses for borrowed code can be found in Settings -> Licenses screen, and also in html/licenses.html file.