-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDockerfile
More file actions
71 lines (55 loc) · 2.33 KB
/
Copy pathDockerfile
File metadata and controls
71 lines (55 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# ROCm ComfyUI Dockerfile
# Based on AMD's official ROCm PyTorch container
FROM rocm/pytorch:rocm7.1.1_ubuntu24.04_py3.12_pytorch_release_2.9.1
# Set working directory
WORKDIR /workspace
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
wget \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Clone ComfyUI and checkout pinned version
RUN git clone https://github.com/comfyanonymous/ComfyUI.git \
&& cd ComfyUI \
&& git checkout v0.3.76
# Set ComfyUI as working directory
WORKDIR /workspace/ComfyUI
# Create necessary directories with separate commands
RUN mkdir -p /workspace/ComfyUI/models/checkpoints && \
mkdir -p /workspace/ComfyUI/models/vae && \
mkdir -p /workspace/ComfyUI/models/loras && \
mkdir -p /workspace/ComfyUI/models/embeddings && \
mkdir -p /workspace/ComfyUI/models/upscale_models && \
mkdir -p /workspace/ComfyUI/models/controlnet && \
mkdir -p /workspace/ComfyUI/output && \
mkdir -p /workspace/ComfyUI/input && \
mkdir -p /workspace/ComfyUI/custom_nodes
# Copy ROCm-tested requirements files
COPY docker/requirements_rocm.txt /workspace/
# Install Python dependencies using ROCm-compatible requirements
# These files have been tested on real AMD hardware and filter out packages that break ROCm
RUN pip install --no-cache-dir -r /workspace/requirements_rocm.txt
# Copy startup script, models config, and sample workflow
COPY docker/startup.sh /workspace/startup.sh
COPY docker/download_models.py /workspace/download_models.py
COPY docker/models.yaml /workspace/models.yaml
COPY docker/sample_workflow.json /workspace/ComfyUI/
# Make startup script executable
RUN chmod +x /workspace/startup.sh
# Environment variables for model download behavior
# MODEL_DOWNLOAD options:
# "default" - Download basic SD 1.5 model (default)
# "all" - Download full model set (SD 1.5, SDXL, ControlNet, etc.)
# "realistic" - Download realistic photo models
# "none" - Skip all downloads, use existing models only
# Custom - Any section name from models.conf
ENV MODEL_DOWNLOAD=none
# Expose ComfyUI port
EXPOSE 8188
# Health check to ensure ComfyUI is running
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8188/ || exit 1
# Use smart startup script that handles model downloads
CMD ["/workspace/startup.sh"]