Stable Diffusion Native Isekai

Description

Did you try the docker guide, but ran out of space in your root partition? Well this guide will install amd's compute stack natively instead of inside a docker.

Installing stable diffusion

Change directory to wherever you want a stable diffusion folder to appear (such as your source code directory), and check out the Stable Diffusion Webui repo.
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
cd stable-diffusion-webui

Time to do some file management. Open dolphin here.
dolphin .

Download sd-v1-4.ckpt and copy it into the stable-diffusion-webui folder. Rename it to model.cpkt.

Download GFPGANv1.3.pth and copy it into the stable-diffusion-webui folder.

Download remacri and/or Lollypop ESRGAN models and place them into stable-diffusion-webui's ESRGAN subfolder.

When you are done, close dolphin.

At this stage you could launch ./webui.sh, but it will fail to run because it expects the wrong version of pytorch. So we have to install the things installed by launch.py by hand.

Install python modules
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/rocm5.1.1
pip3 install transformers==4.19.2 diffusers invisible-watermark --prefer-binary
pip3 install git+https://github.com/crowsonkb/k-diffusion.git --prefer-binary
pip3 install git+https://github.com/TencentARC/GFPGAN.git --prefer-binary
pip3 install -r repositories/CodeFormer/requirements.txt --prefer-binary
pip3 install -r requirements.txt --prefer-binary
pip3 install -U numpy --prefer-binary
pip3 install scipy pyyaml

Install repositories
mkdir repositories
git clone https://github.com/CompVis/stable-diffusion.git repositories/stable-diffusion
git clone https://github.com/CompVis/taming-transformers.git repositories/taming-transformers
git clone https://github.com/sczhou/CodeFormer.git repositories/CodeFormer
git clone https://github.com/salesforce/BLIP.git repositories/BLIP

Run the webui
python stable-diffusion-webui/webui.py

Commandline arguments are described in the main guide and are added at the end of the previous command like this:
python stable-diffusion-webui/webui.py --medvram --opt-split-attention

Enjoy!

Note

If you get the error message hipErrorNoBinaryForGpu: Unable to find code object for all current devices! you may need to add HSA_OVERRIDE_GFX_VERSION=10.3.0 to your /etc/environment and reboot.

Edit
Pub: 15 Sep 2022 13:56 UTC
Views: 2707