- README: rewritten for this fork — build with docker compose, clone ComfyUI yourself as the mount, gfx1201 (RX 9700) confirmed working - docker-compose.yml: add build: context, local image tag, ./ComfyUI volume, restore shm_size/render group/ipc, remove external proxy-network - docker-run.sh: build locally, matching image tag and container name - add .gitignore for the ComfyUI mount
5.4 KiB
ComfyUI for gfx1151 (Ryzen AI MAX / Strix Halo)
Dockerized ComfyUI with PyTorch & flash-attention for gfx1151 (AMD Strix Halo,
e.g. Ryzen AI Max+ 395 — Minisforum MS-S1 Max, Framework Desktop), based on AMD's
pre-built and pre-configured rocm/pytorch image (no custom wheels needed).
This is my working setup, adapted from
ignatberesnev/comfyui-gfx1151
(see Acknowledgements). The difference here: this repo is meant to
be built locally with docker compose build — no image pull required.
Reported working on:
- Minisforum MS-S1 Max (Ryzen AI Max+ 395, gfx1151) — daily driver
- AMD Radeon RX 9700 (gfx1201), 32 GB — works out of the box (thanks!)
Versions used:
- ROCm: 7.2.4
- PyTorch: 2.9.1
- Python: 3.12
- ComfyUI: whatever you clone (see below)
Note
I got this working after a day of digging, and the final solution turned out to be much simpler than most of what's out there. I don't claim to understand every moving part — if you know better, PRs and comments welcome.
Get started
1. Clone ComfyUI yourself
The container mounts ComfyUI from the host, so you can update it independently of the
image. Clone it into this directory (or anywhere — just adjust the volume path in
docker-compose.yml):
git clone https://github.com/comfyanonymous/ComfyUI
If the mounted directory is empty when the container starts, a pre-cloned (baked-in) copy of ComfyUI is copied into it automatically — but bringing your own clone is the recommended way.
2. Build and run
docker compose up -d --build
ComfyUI is available at http://localhost:8188. The starter templates should generate images without any issues.
3. Verify the GPU works
While the container is running:
# PyTorch sees the GPU
docker exec -it comfyui /bin/bash /opt/comfyui-gfx1151-utils/test-pytorch.sh
# flash-attention (Triton backend) works
docker exec -it comfyui python3 /opt/comfyui-gfx1151-utils/test-pytorch-flashattention.py
Both should run without errors (sample output in the upstream README).
What's configured
build: .— image is built from the Dockerfile in this reposhm_size: 8G— shared memory for PyTorch/ComfyUI. Should NOT be larger than available RAM; this is not VRAM. Feel free to lower it../ComfyUI:/opt/ComfyUI— your ComfyUI clone (models, custom nodes, output all live in here)- Port
8188exposed /dev/kfd,/dev/dri+video/rendergroups — GPU access. Works as-is on Arch; may need extra steps on Ubuntu, untested.TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1— enables the experimental AOTriton backend
No reverse proxy / external network is configured — it binds 8188 directly. Put it
behind whatever you like if you need auth/TLS.
Updating
-
ComfyUI:
cd ComfyUI && git pull, thendocker compose restart. Custom nodes: the ComfyUI Manager is enabled (--enable-manager), or install from inside the container:docker exec -it comfyui /bin/bash cd /opt/ComfyUI && pip install -r requirements.txt -
ROCm / PyTorch: bump the
FROM rocm/pytorch:...line in the Dockerfile and theimage:tag indocker-compose.yml, thendocker compose up -d --build.
What's inside / how it works
The image is based on AMD's rocm/pytorch image (Ubuntu 24.04, ROCm, Python 3.12, PyTorch) where everything is configured to work together — see AMD's docs.
Only two pieces are added: ComfyUI (nothing special — bring your own clone) and
flash-attention. The latter "doesn't work" out of the box on AMD's image: it lacks
the frontend APIs but ships the Triton backend. Setting
FLASH_ATTENTION_TRITON_AMD_ENABLE=TRUE makes flash-attention install fast and route
to Triton, which does the actual work. It's cloned from the main_perf branch of
ROCm/flash-attention — that's what others
(vLLM on Strix Halo, kyuz0's setups) use, presumably for
Triton support not yet in main (see
ROCm/flash-attention#27).
The scripts/ directory holds the test scripts above; they're baked into the image at
/opt/comfyui-gfx1151-utils/.
What did NOT work (so you don't try it)
- Custom-built wheel setups (e.g. pccr10001/comfyui-gfx1151-fa) — never worked for me, presumably non-locked dependencies pulling newer ROCm under old wheels. Huge thanks to them for the pointers though.
ghcr.io/rocm/therock_pytorch_dev_ubuntu_24_04_gfx1151— no longer published.- Speed "tuning" env vars (
PYTORCH_TUNABLEOP_ENABLED,MIOPEN_FIND_MODE,ROCBLAS_USE_HIPBLASLT) — made things slower and (probably) crashed my X11 display server during SD runs. Don't add them unless you enjoy that.
Acknowledgements
- ignatberesnev — original repo this is based on
- pccr10001, lhl, kyuz0 — for setting everyone on the right path