|
FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04 |
|
|
|
|
|
ENV PYTHONUNBUFFERED=1 \ |
|
PYTHONDONTWRITEBYTECODE=1 \ |
|
PIP_NO_CACHE_DIR=1 \ |
|
DEBIAN_FRONTEND=noninteractive |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
python3.10 python3-pip git wget curl \ |
|
libgl1-mesa-glx libglib2.0-0 libsm6 libxrender1 libxext6 ffmpeg \ |
|
git-lfs \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN git lfs install |
|
|
|
|
|
RUN git clone --depth 1 https://github.com/comfyanonymous/ComfyUI.git |
|
|
|
|
|
|
|
RUN git clone --depth 1 https://github.com/cubiq/ComfyUI_IPAdapter_plus.git /app/ComfyUI/custom_nodes/IPAdapter_plus || echo "Failed to clone IPAdapter_plus but continuing" && \ |
|
git clone --depth 1 https://github.com/Kosinkadink/ComfyUI-KJNodes.git /app/ComfyUI/custom_nodes/KJNodes || echo "Failed to clone KJNodes but continuing" && \ |
|
git clone --depth 1 https://github.com/SSitu/ComfyUI_UltimateSDUpscale.git /app/ComfyUI/custom_nodes/UltimateSDUpscale || echo "Failed to clone UltimateSDUpscale but continuing" && \ |
|
git clone --depth 1 https://github.com/cg196/ComfyUI-UseEverywhere.git /app/ComfyUI/custom_nodes/UseEverywhere || echo "Failed to clone UseEverywhere but continuing" && \ |
|
git clone --depth 1 https://github.com/melMass/comfy-mtb.git /app/ComfyUI/custom_nodes/mtb || echo "Failed to clone mtb but continuing" && \ |
|
git clone --depth 1 https://github.com/LucianoCirino/ComfyUI_Masquerade.git /app/ComfyUI/custom_nodes/Masquerade || echo "Failed to clone Masquerade but continuing" && \ |
|
git clone --depth 1 https://github.com/Fannovel16/comfyui-save-image-with-geninfo.git /app/ComfyUI/custom_nodes/SaveGenInfo || echo "Failed to clone SaveGenInfo but continuing" && \ |
|
git clone --depth 1 https://github.com/jamesWalker55/comfyui-various.git /app/ComfyUI/custom_nodes/Various || echo "Failed to clone Various but continuing" |
|
|
|
|
|
RUN mkdir -p /app/ComfyUI/custom_nodes/PuLID |
|
|
|
|
|
RUN mkdir -p /app/ComfyUI/models/checkpoints \ |
|
/app/ComfyUI/models/controlnet \ |
|
/app/ComfyUI/models/ipadapter \ |
|
/app/ComfyUI/models/pulid \ |
|
/app/ComfyUI/models/clip_vision \ |
|
/app/ComfyUI/input \ |
|
/app/ComfyUI/output \ |
|
/app/workflows \ |
|
/tmp/comfyui_user \ |
|
/tmp/comfyui_input \ |
|
/tmp/comfyui_output \ |
|
/tmp/comfyui_temp \ |
|
/tmp/workflows \ |
|
/tmp/comfyui_models \ |
|
/tmp/comfyui_models/pulid |
|
|
|
|
|
RUN chmod -R 777 /app/ComfyUI/output \ |
|
/tmp/comfyui_user \ |
|
/tmp/comfyui_input \ |
|
/tmp/comfyui_output \ |
|
/tmp/comfyui_temp \ |
|
/tmp/workflows \ |
|
/tmp/comfyui_models \ |
|
|| echo "Failed to set permissions, continuing anyway" |
|
|
|
|
|
COPY requirements.txt . |
|
COPY app.py . |
|
COPY start.sh . |
|
COPY download_models.py . |
|
|
|
|
|
|
|
COPY workflows/ /app/workflows/ |
|
|
|
|
|
RUN echo "PuLID nodes will be downloaded at runtime" > /app/ComfyUI/custom_nodes/PuLID/README.txt |
|
|
|
|
|
RUN chmod +x /app/start.sh |
|
|
|
|
|
RUN pip3 install --no-cache-dir -r requirements.txt |
|
|
|
|
|
RUN python3 download_models.py || echo "Initial model download failed, will retry at runtime" |
|
|
|
|
|
EXPOSE 7860 8188 |
|
|
|
|
|
ENTRYPOINT ["/app/start.sh"] |
|
|