How to use Stable Diffusion XL locally with AMD ROCm. With AUTOMATIC1111 WebUI and ComfyUI on Linux.

preview_player
Показать описание
Use Stable Diffusion XL/SDXL locally with AMD ROCm on Linux.
Install both AUTOMATIC1111 WebUI and ComfyUI.

Information about SDXL and AMD ROCm:

AUTOMATIC1111-Stable-Diffusion-WebUI:
ComfyUI:

GIT, frequently already included in Linux distributions:

Miniconda:

Test: Does PyTorch use ROCm?

Taken from this website:

Get SDXL models here:

Good prompt examples for SDXL:

Good workflow for ComfyUI:

In case you want to try MS Windows DirectML version of WebUI:

My video on how to create a bootable USB-Stick with Ubuntu Linux for GPT/UEFI. The easiest way.
Рекомендации по теме
Комментарии
Автор

Yours is the only tutorial out of the dozens I've watched that managed to get SD working on my setup thank you. Liked and subbed. Cheers!

pkeckuk
Автор

OMG, thank you so much for this tutorial. It's given me all the clues I need to get SDXL going on a number of linux distros. Thus far, I've been successful with Nobara, PikaOS and Ubuntu!. I think I'm gonna try Arch next! Thanks again!

the.wanginator
Автор

Thank you very much for sharing your video and for creating this English version.

LouisCheungCN
Автор

I need to thank you for this tutorial, really helpful!😉

Sleeace
Автор

Thanks for this very comprehensive video! This field is moving fast so finding up to date instructions is difficult!

I followed the instructions to install Stable Diffusion on Linux Mint 21.2 with a 6800XT. The only change had to make was using rocm5.4.2 when installing torch, I was getting a segmentation fault with 5.6.
I'm getting around 7-8 iterations/s. On windows on the same machine, using directML (I think, not sure) I was getting around 1.5 iterations/s.

The links are broken in the description, I think they were copied from another description so they are truncated. It would also help to have all the commands in a gist or in the description.

TM_
Автор

Man, you are the LEGEND! Saved my life!!

hp
Автор

Thank you! This worked for me with Linux Mint 21.2 Edge, RX 7900 XTX, Kernel 6.2.0-33, ROCm 5.6.5. When I tried Ubuntu 22.04 I had no graphics acceleration after reboot.

lwb
Автор

Thanks for your howto, wonderful! It is working on my Linux Mint 21.2, Ryzen 5900x and RX6750XT. I used amdgpu driver 5.7 and rocm 5.7, but I can only generate images up to 768x768, higher causes error because of low VRAM (12gb) ^_^

I would be happy to see more videos on certain techniques like upscaling, creating new creations from existing images/photos or animations.

Hopefully the new One Click Installer "Stability Matrix" will run with AMD at some point... currently only nvidia is supported.

mac
Автор

Thanks for the detailed tutorial
I followed along with Kubuntu 22.04, same kernel as in the video and a 6700XT.
ROCm 5.6 installed correctly but both Automatic1111 and ComfyUI failed to start.

tried with ROCm 5.4.2, ComfyUI still fails to start (segmentation fault), but good news, A1111 worked fine with around 3 it/s at 768x512 resolution, also tried SDXL 1.0, with 1024x1024 resolution with base model only, it works but it sometimes freezes the computer, using the refiner though is a no go, I guess loading both the base model AND the refiner does not leave much VRAM for the generation process to work with.

Also wanted to share this pro tip, you can use the checkpoints, embeddings, LoRAs... that are already in A1111 instead of duplicating them into ComfyUI folder, for this go to ComfyUI folder, remove the .example from the file and edit the file to add your A1111 path next to base_path: it should look something like this:

a1111:
base_path:

Vayrn
Автор

Great video. I got my rx 6600m running stable diffusion.

acnews
Автор

Thank you for making this. I've been trying for multiple days to setup SD with a RDNA1 card (5700) using ROCm but on arch.
I've tried every install variant including the rentry amd focused guides and both automatic1111 & comfyui but ran into a plethora of different issues.
I'll give this a try with a fresh ubuntu install as a last attempt but one concern I have is at 9:36 you'd need a torch version of 1.x as anything higher than 2.0 seems to break the gfx override which is needed for cards that are not officially supported for ROCm such as below (and not including) the 6800. (if not the case it's at least the case with RDNA1 cards).
It would be much appreciated you could provide an alternative command to adjust for such a torch version along with its appropriate dependencies.

capsized
Автор

In future you should move your terminal window slightly higher on the screen, as when the video is paused on YouTube the media controls obstruct the commands you're entering. Thanks for the video.

rupertmediao
Автор

7900 XTX with ROCm 5.7 and Ubuntu 22.04, having success with these instructions. At the end I was getting some kind of HIP error on startup, but it went away after a reboot.

Apologies, I don't remember the exact error any more. But it had some note that some kind of parameter could be passed to enable hardware assertions or some such. My google-fu totally failed me when I tried to search for solutions to that kind of error.

mikharju
Автор

I got tired with Window's bullshit so I came to Arch Linux, thanks for this video

fgmqdgd
Автор

10:36 i got a "False" in the second test, but i didn't get an error before while installing the sd-webui with the git clone command. i just acted like the error appeared and followed your fix. then i tested import torch print torch.cuda available etc. pp. and i got "true" - a possible fix for the problem. I'm just glad i don't need to to all the stuff again :D

agansa
Автор

Thanks for all your help on this. I used your other video to get Linux set up and am currently trying to get the SD up and running. Here is my issue, I can get webui up and running, I type a simple prompt, it seems to run, even showing me an image starting to render, but then I get an error:
NotImplementedError: No operator found for etc

After a quick google, I found that I need to install xformers again. So I activate sd, then run:
!pip install --pre -U xformer

But then I get the error saying:
ERROR: Could not find a version that satisfies the requirement install (from versions: none)
ERROR: No matching distribution found for install

It seems that maybe there is a conflict with the version of python or something? I am using the one you recommend. I am a bit of a noob at this but have gone through the process a few times and believe I am getting it right up until now. Any help would be appreciated. I am on an RX 6600 (wishing I got an nvidia)

harrisonajones
Автор

I followed one of your other videos and got ComfyUI working through Zluda on Windows, but wanted to see what the difference would be when running it through Linux. I have Ubuntu 24.04 installed now, will that change the steps you outlined in your video?

FoxTroupe
Автор

Thank you!

Is it possible to work using your method on VirtualBox?

I have an RX580 8GB video card, will I be able to work in Stable Diffusion XL at least with 512x512 expansion

When running in Windows XL the model writes that it does not have enough memory

БазаМакарона
Автор

thank you for this step by step and detailed tutorial. I followed all exaclty, word by word. I'm at the end of the major part of the whole process where 'bash launch.sh' is. Unfortunately it returns error RuntimeError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check. Need help to identify what this is. Also, i am using AMD RX580 (8gb), what would be the settings in 'launch.sh' should I use 10.3.0? I have not encountered any other errors or failures throughout the whole process/installation, except this at this stage. THANKS AGAIN FOR THIS VIDEO! I'm on Ubuntu 22.04 LTS.

hakkobiggo
Автор

Thank you for this walkthrough. I installed package, and saw on the last step you're execting: pip3 install --pre torch torchvision torchaudio --index-url for rocm5.6 Will this command work on my installed rocm version 6.0? I couldn't find any torch compatible for rocm 6.0. On the official documentation they also give 5.6 on their example but not sure it would be compatible. my gfx is 1030

trnd