# ComfyUI on the gfx1151 (AMD Strix Halo / Radeon 8060S) ROCm torch build. # # Base image: AMD's gfx1151-tagged vLLM image. It is the only verified build # where torch.cuda.is_available() is True on this APU (device capability # (11,5) = gfx1151). It already ships the matching ROCm torch family # (torch 2.9.1+rocm, torchvision 0.24.0+rocm, torchaudio 2.9.0+rocm), so we # must NOT let pip reinstall them: ComfyUI's requirements.txt lists an unpinned # `torch`, which would otherwise clobber the gfx1151 kernels with a default build. FROM docker.io/rocm/vllm:rocm7.12.0_gfx1151_ubuntu24.04_py3.12_pytorch_2.9.1_vllm_0.16.0 # Bake the ComfyUI code into the image (rebuild the image to update the code). RUN git clone --depth 1 https://github.com/comfyanonymous/ComfyUI /opt/ComfyUI WORKDIR /opt/ComfyUI # Pre-create the user-data dirs. The host mounts its collections over them # (see the comfyui service in compose.yaml). RUN mkdir -p /opt/ComfyUI/models /opt/ComfyUI/input /opt/ComfyUI/output /opt/ComfyUI/custom_nodes # Install ComfyUI's dependencies, but skip the torch family (already present # above as the gfx1151 ROCm builds). torchsde and the rest are kept. RUN grep -viE '^(torch|torchvision|torchaudio)([^a-z]|$)' requirements.txt > /tmp/req-notorch.txt \ && pip install --no-cache-dir -r /tmp/req-notorch.txt # The city96/ComfyUI-GGUF custom node (loaded from the host's custom_nodes # volume) needs the gguf library to decode GGUF-quantized diffusion models. # sentencepiece and protobuf are its optional tokenizer deps. Baking them into # the image keeps the dependency across container recreations — the node itself # lives in the host volume, which persists, but the Python env does not. RUN pip install --no-cache-dir "gguf>=0.13.0" sentencepiece protobuf # Bake the qwen_image21 patch script into the image. It is run by the # startup wrapper before ComfyUI starts, so the patch survives container COPY dankclaw/apply_qwen21_patch.py /opt/ComfyUI/apply_qwen21_patch.py COPY dankclaw/comfyui-start.sh /opt/ComfyUI/comfyui-start.sh RUN chmod +x /opt/ComfyUI/comfyui-start.sh CMD ["/opt/ComfyUI/comfyui-start.sh"] EXPOSE 8188 # v2: VAE 4D-to-5D latent expansion for video VAEs (qwen_image21) # v3: fix in_channels to use shape[0] (latent input dim) not shape[1] (hidden dim)