My Experiences with ComfyUI on an RX 9070XT

I thought I would post my experience trying to get ComfyUI to work properly with an RX 9070XT and fairly modest hardware (an i5-12600K with 32GB DDR5 RAM).

This is going to be kind of a long post because I wanted to describe what I did and the process I used to get it working, in case someone else is having trouble getting things working or is just interested in trying ComfyUI.

The TL;DR, ComfyUI works pretty well with an RX 9070XT once you actually get it working which is not as easy as it might seem. Image gen is pretty much lightning fast, less than 30s per generation unless you have a crazy number of steps or you’re using a ton of LoRAs. Video Generation with LTX / WAN is possible and works, it takes about 5-8 minutes to generate a 20 second video clip with LTX 2.3, I don’t know if that’s good or not.

Long version: I use my PC primarily for gaming and I didn’t like the fact that the instructions for installing ROCm included installing the AMDGPU Pro drivers which I’ve heard aren’t as good for gaming as the in-kernel AMDGPU driver. I didn’t want to mess up my system so I opted to install ComfyUI inside a Docker container instead. This also gave me an opportunity to learn Docker which I had never used before.

I first came across an official Docker container from AMD that has ComfyUI so I decided to install it. It was a disaster. ComfyUI runs, but it’s a very very old version and also apparently a custom fork from AMD. When I tried to install custom nodes, everything broke and it wouldn’t start up anymore. No Bueno.

Next, I found docker images by AMD for ROCm and PyTorch. This seemed more promising, maybe I can just use those as a base for installing ComfyUI on top of. This is where the rabbithole of different ROCm / PyTorch versions began.

I dove into the docs and learned about Dockerfiles and docker-compose.yaml and all the rest and then came up with a dockerfile that pulled the official AMD ROCm/PyTorch image, copied it into a new container, installed ComfyUI and ComfyUI manager, then I created a docker-compose that added all the needed environment variables and implemented an auto-restart function in case ComfyUI dies for some reason.

I decided to start with the very latest ROCm and PyTorch version which as of this writing is ROCm 7.2.4 and PyTorch 2.13.

Everything seemed to work, once docker was done pulling the file, installing ComfyUI and booting up I was greeted with the ComfyUI Webpage at http://127.0.0.1:8188 success! I thought… This is where I ran into the first problem. How do I load models into ComfyUI, how do I access the outputs? And then there was the issue that whenever I installed custom nodes and then recreated the container they would all disappear. It was time to learn about Volumes and bind-mounts. Yay!

I decided the best way to maintain a working install was to create bind mounts for the Python Virtual Environment, the input, the output, the models folder, the custom_nodes folder and the user directory. This way I could try different ROCm / PyTorch versions and I wouldn’t lose custom nodes and settings.

The more I worked with it the more I came to realize that Docker REALLY isn’t made to work the way I’m trying to use it. Something like Flatpak or maybe DistroBox might make more sense, in the future I may try those solutions but for now Docker it is.

Once I got bind mounts figured out and I created a custom build script that built the image, then copied the files to the bind mounts, then started up the container I had a working setup and this time with an up-to-date version of ComfyUI. Yay again!

This is kinda where the rabbit hole starts, once I started playing around with Image generation I was having a ton of fun, so then I decided to try Video generation. Yeah, that didn’t work out so well. It sorta-kinda worked, but I experienced a ton of OOMs and when it didn’t OOM, it would just sorta stall forever stuck in some kind of loop or race condition. Very frustrating. I tried a huge number of switches, disabling smart memory, pinned memory, async offload, etc. Nothing seemed to really help.

At this point I decided to check the usual sources like Reddit and the Level1 forums. It seemed the general consensus was that a combination of ROCm 7.1 and PyTorch 2.9.1 worked the best, had the fewest OOMs and stalls. Luckily AMD has a ROCm/Pytorch image with that exact combination so I modified my Dockerfile and pulled that image.

This seemed to be the answer, I actually got my first video to actually generate. Super exciting!

I am terrible at ComfyUI, the spaghetti is super confusing and it’s hard to figure out which nodes I’m supposed to use for which things but I’m slowly getting it. Civitai.com seems to be a pretty good resource for models and information.

So that’s it, as of right now ROCm 7.1 with PyTorch 2.9.1 seems to be the sweet spot at least for me. In the future I plan to try newer versions as they come out to see if I can get it working even better. Hopefully this is helpful to someone wanting to do something similar. If someone wants my janky dockerfile or docker-compose.yaml I’m happy to share.

I’ve also installed llama.cpp for general chatbot and coding use. Setting up llama.cpp was SOOO Much easier because it can use Vulkan for it’s backend… I know PyTorch is supposed to be the industry standard but from a user standpoint it’s just god awful to use, there are so many different combinations of ROCm / PyTorch, some work, some don’t. It seems like that might just be a ROCm problem though, if I could afford the nVidia tax I think maybe I wouldn’t have all these issues.

If you made it though all that, thanks! Again, I hope it helps someone.

6 Likes

The fact that ROCm 7.1 and PyTorch 2.9.1 took you from repeat OOMs and stalls to a successful video run makes that container image a sensible baseline. Keep its build tags and bind-mounted model and custom_nodes paths as a known-good checkpoint, then test later versions separately without overwriting it.

Agreed, I’m actually still using this combo because it still seems to be the best. I’ve created a build script in bash that allows me to just plug in a version of ROCm, PyTorch and ComfyUI without messing with the dockerfile or compose file and it’ll just make me a new local image with these versions. This might not be the best way to do things but it’s been the best way I could figure out. Bind mounts in Dockerfiles are ephemeral, they only last for the duration of one command making them extremely limited in their usefulness.

I also realize I could just use a python virtual environment in my home directory instead of Docker but I feel like using Docker with predefined base images gives me more repeatability in my setup. For example what if my Distro updates some package that subtly breaks things? Unlikely but it still could happen.

Upon further experiments I also think some of the OOM and hangs might be caused by RAM exhaustion. My system “only” has 32GB of RAM and I’m also using it as my primary rig. I notice if I stop my DE and drop down to a TTY and then use ComfyUI from my laptop I can do a bit more because there’s more free RAM.

Hopefully someday RAM won’t be stupid expensive and I can upgrade. I’m kicking myself that I didn’t go with 64GB when I built my system, it would have cost as much as 16GB costs now.