commit 271895b0e958a731033b455298b867abe81f26a8 Author: ari Date: Sun Apr 12 16:09:52 2026 -0400 v1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bf70ae8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +models +output diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..7b1f539 --- /dev/null +++ b/Containerfile @@ -0,0 +1,72 @@ +FROM rocm/pytorch:rocm7.1_ubuntu24.04_py3.12_pytorch_release_2.6.0 + +# ─── ROCm environment for gfx1151 (Strix Halo) ─────────────────────────── +ENV HSA_OVERRIDE_GFX_VERSION=11.5.1 +ENV HSA_ENABLE_SDMA=0 +ENV ROCBLAS_USE_HIPBLASLT=1 +ENV PYTORCH_HIP_ALLOC_CONF=expandable_segments:False +ENV HIP_LAUNCH_BLOCKING=1 + +# ─── Clone ComfyUI ──────────────────────────────────────────────────────── +ARG COMFYUI_COMMIT=master +ENV COMFYUI_PATH=/workspace/ComfyUI + +RUN git clone https://github.com/comfyanonymous/ComfyUI "$COMFYUI_PATH" \ + && cd "$COMFYUI_PATH" \ + && if [ "$COMFYUI_COMMIT" != "master" ]; then git checkout "$COMFYUI_COMMIT"; fi + +# ─── Pin PyTorch to ROCm 6.2.4 wheels FIRST ────────────────────────────── +# Must be a separate step — mixing --index-url with -r requirements.txt +# breaks PyPI resolution for all the non-torch packages. +# RUN pip install --no-cache-dir --force-reinstall \ +# torch torchvision torchaudio \ +# --index-url https://download.pytorch.org/whl/rocm6.2.4 +RUN pip install --no-cache-dir --pre torch torchvision torchaudio \ + --index-url https://download.pytorch.org/whl/nightly/rocm6.3 + +# ─── Install ComfyUI requirements from PyPI (no index-url override) ─────── +RUN pip install --no-cache-dir -r "$COMFYUI_PATH/requirements.txt" + +# ─── Custom nodes ───────────────────────────────────────────────────────── + +# ComfyUI-Manager +RUN git clone https://github.com/ltdrdata/ComfyUI-Manager \ + "$COMFYUI_PATH/custom_nodes/ComfyUI-Manager" \ + && pip install --no-cache-dir \ + -r "$COMFYUI_PATH/custom_nodes/ComfyUI-Manager/requirements.txt" + +# WAN 2.1 video nodes +RUN git clone https://github.com/kijai/ComfyUI-WanVideoWrapper \ + "$COMFYUI_PATH/custom_nodes/ComfyUI-WanVideoWrapper" \ + && pip install --no-cache-dir \ + -r "$COMFYUI_PATH/custom_nodes/ComfyUI-WanVideoWrapper/requirements.txt" \ + || true + +# Video Helper Suite +RUN git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite \ + "$COMFYUI_PATH/custom_nodes/ComfyUI-VideoHelperSuite" \ + && pip install --no-cache-dir \ + -r "$COMFYUI_PATH/custom_nodes/ComfyUI-VideoHelperSuite/requirements.txt" \ + || true + +# ─── Model directories ──────────────────────────────────────────────────── +RUN mkdir -p \ + "$COMFYUI_PATH/models/checkpoints" \ + "$COMFYUI_PATH/models/vae" \ + "$COMFYUI_PATH/models/loras" \ + "$COMFYUI_PATH/models/unet" \ + "$COMFYUI_PATH/models/clip" \ + "$COMFYUI_PATH/models/controlnet" \ + "$COMFYUI_PATH/output" + +# NOTE: sageattention removed — CUDA-only, won't build on ROCm. +# --use-pytorch-cross-attention below is the ROCm-compatible equivalent. + +WORKDIR "$COMFYUI_PATH" +EXPOSE 8188 + +CMD ["python", "main.py", \ + "--listen", "0.0.0.0", \ + "--port", "8188", \ + "--use-pytorch-cross-attention", \ + "--cpu-vae"] diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..9f752a1 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,24 @@ +services: + comfyui: + build: + context: . + dockerfile: Containerfile + container_name: comfyui + devices: + - /dev/kfd + - /dev/dri + group_add: + - video + - render + ipc: host + network_mode: host + restart: unless-stopped + environment: + HSA_OVERRIDE_GFX_VERSION: 11.5.1 + HSA_ENABLE_SDMA: 0 + ROCBLAS_USE_HIPBLASLT: 1 + PYTORCH_HIP_ALLOC_CONF: expandable_segments:False + HIP_LAUNCH_BLOCKING: 1 + volumes: + - ./models:/workspace/ComfyUI/models + - ./output:/workspace/ComfyUI/output