From b8f7d01af87e8779fcdc694c6efbe896caa1cd14 Mon Sep 17 00:00:00 2001 From: thelastblt <166474022+thelastblt@users.noreply.github.com> Date: Mon, 25 May 2026 13:51:59 -0700 Subject: [PATCH 1/3] Update Dockerfile for new PyTorch and CUDA versions - Updated PyTorch and CUDA versions to latest. - Updated ComfyUI version. - Removed ComfyUI Manager installation as it's now bundled. - Added --break-system-packages flag to python requirement install to avoid the externally managed library error. NOTE: Best practice requires using a venv, but I opted for a less virtualized version since this is running in docker. - Added manager_requirements for the ComfyUI Manager install --- source/Dockerfile | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/source/Dockerfile b/source/Dockerfile index 76d3cc2..490bd99 100644 --- a/source/Dockerfile +++ b/source/Dockerfile @@ -1,22 +1,22 @@ # Defines build arguments for the versions of PyTorch, CUDA, and cuDNN to use -ARG PYTORCH_VERSION=2.9.1 -ARG CUDA_VERSION=12.8 +ARG PYTORCH_VERSION=2.12.0 +ARG CUDA_VERSION=13.0 ARG CUDNN_VERSION=9 # This image is based on the latest official PyTorch image, because it already contains CUDA, CuDNN, and PyTorch FROM pytorch/pytorch:${PYTORCH_VERSION}-cuda${CUDA_VERSION}-cudnn${CUDNN_VERSION}-runtime # Defines build arguments for the versions of ComfyUI and ComfyUI Manager to use -ARG COMFYUI_VERSION=0.8.2 -ARG COMFYUI_MANAGER_VERSION=4.0.5 +ARG COMFYUI_VERSION=0.22.0 # Installs Git, because ComfyUI and the ComfyUI Manager are installed by cloning their respective Git repositories RUN apt-get update --assume-yes && \ apt-get install --assume-yes \ git \ sudo \ - libgl1-mesa-glx \ + libgl1 \ + libglx-mesa0 \ libglib2.0-0 && \ rm -rf /var/cache/apt/archives /var/lib/apt/lists/* @@ -25,20 +25,12 @@ RUN git clone https://github.com/Comfy-Org/ComfyUI.git /opt/comfyui && \ cd /opt/comfyui && \ git checkout "v${COMFYUI_VERSION}" -# Clones the ComfyUI Manager repository and checks out the latest release; ComfyUI Manager is an extension for ComfyUI that enables users to install -# custom nodes and download models directly from the ComfyUI interface; instead of installing it to "/opt/comfyui/custom_nodes/ComfyUI-Manager", which -# is the directory it is meant to be installed in, it is installed to its own directory; the entrypoint will symlink the directory to the correct -# location upon startup; the reason for this is that the ComfyUI Manager must be installed in the same directory that it installs custom nodes to, but -# this directory is mounted as a volume, so that the custom nodes are not installed inside of the container and are not lost when the container is -# removed; this way, the custom nodes are installed on the host machine -RUN git clone https://github.com/Comfy-Org/ComfyUI-Manager.git /opt/comfyui-manager && \ - cd /opt/comfyui-manager && \ - git checkout ${COMFYUI_MANAGER_VERSION} +# Removed ComfyUI Manager since it's now bundled with ComfyUI. # Installs the required Python packages for both ComfyUI and the ComfyUI Manager -RUN pip install \ +RUN pip install --break-system-packages \ --requirement /opt/comfyui/requirements.txt \ - --requirement /opt/comfyui-manager/requirements.txt + --requirement /opt/comfyui/manager_requirements.txt # Sets the working directory to the ComfyUI directory WORKDIR /opt/comfyui From a94966f0a43408423dc44bf028efcc2dcee9e730 Mon Sep 17 00:00:00 2001 From: thelastblt <166474022+thelastblt@users.noreply.github.com> Date: Sun, 31 May 2026 20:37:37 -0700 Subject: [PATCH 2/3] Update entrypoint.sh with ComfyUI Manager changes Updated the entrypoint script - to include additional model directories - modified the installation of custom node requirements to use --break-system-packages - removed ComfyUI Manager changes --- source/entrypoint.sh | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/source/entrypoint.sh b/source/entrypoint.sh index 11e5f68..413a061 100644 --- a/source/entrypoint.sh +++ b/source/entrypoint.sh @@ -3,6 +3,8 @@ # Creates the directories for the models inside of the volume that is mounted from the host echo "Creating directories for models..." MODEL_DIRECTORIES=( + "audio_encoders" + "background_removal" "checkpoints" "clip" "clip_vision" @@ -11,9 +13,14 @@ MODEL_DIRECTORIES=( "diffusers" "diffusion_models" "embeddings" + "frame_interpolation" + "geometry_estimation" "gligen" "hypernetworks" + "latent_upscale_models" "loras" + "model_patches" + "optical_flow" "photomaker" "style_models" "text_encoders" @@ -26,27 +33,17 @@ for MODEL_DIRECTORY in ${MODEL_DIRECTORIES[@]}; do mkdir -p /opt/comfyui/models/$MODEL_DIRECTORY done -# Creates the symlink for the ComfyUI Manager to the custom nodes directory, which is also mounted from the host -echo "Creating symlink for ComfyUI Manager..." -rm --force /opt/comfyui/custom_nodes/ComfyUI-Manager -ln -s \ - /opt/comfyui-manager \ - /opt/comfyui/custom_nodes/ComfyUI-Manager - # The custom nodes that were installed using the ComfyUI Manager may have requirements of their own, which are not installed when the container is # started for the first time; this loops over all custom nodes and installs the requirements of each custom node echo "Installing requirements for custom nodes..." for CUSTOM_NODE_DIRECTORY in /opt/comfyui/custom_nodes/*; do - if [ "$CUSTOM_NODE_DIRECTORY" != "/opt/comfyui/custom_nodes/ComfyUI-Manager" ]; + if [ -f "$CUSTOM_NODE_DIRECTORY/requirements.txt" ]; then - if [ -f "$CUSTOM_NODE_DIRECTORY/requirements.txt" ]; - then - CUSTOM_NODE_NAME=${CUSTOM_NODE_DIRECTORY##*/} - CUSTOM_NODE_NAME=${CUSTOM_NODE_NAME//[-_]/ } - echo "Installing requirements for $CUSTOM_NODE_NAME..." - pip install --requirement "$CUSTOM_NODE_DIRECTORY/requirements.txt" - fi + CUSTOM_NODE_NAME=${CUSTOM_NODE_DIRECTORY##*/} + CUSTOM_NODE_NAME=${CUSTOM_NODE_NAME//[-_]/ } + echo "Installing requirements for $CUSTOM_NODE_NAME..." + pip install --break-system-packages --requirement "$CUSTOM_NODE_DIRECTORY/requirements.txt" fi done @@ -63,6 +60,7 @@ if [ -z "$USER_ID" ] || [ -z "$GROUP_ID" ]; then echo "Running container as $USER..." exec /opt/conda/bin/python main.py \ + --enable-manager --port 8188 \ --listen 0.0.0.0 \ --disable-auto-launch \ @@ -72,12 +70,12 @@ else getent group $GROUP_ID > /dev/null 2>&1 || groupadd --gid $GROUP_ID comfyui-user id -u $USER_ID > /dev/null 2>&1 || useradd --uid $USER_ID --gid $GROUP_ID --create-home comfyui-user chown --recursive $USER_ID:$GROUP_ID /opt/comfyui - chown --recursive $USER_ID:$GROUP_ID /opt/comfyui-manager export PATH=$PATH:/home/comfyui-user/.local/bin echo "Running container as comfyui-user ($USER_ID:$GROUP_ID)..." sudo --set-home --preserve-env=PATH --user \#$USER_ID \ /opt/conda/bin/python main.py \ + --enable-manager --port 8188 \ --listen 0.0.0.0 \ --disable-auto-launch \ From 93df9e9971847825016f7cb5cc83bb7bb71ba82a Mon Sep 17 00:00:00 2001 From: thelastblt <166474022+thelastblt@users.noreply.github.com> Date: Sun, 31 May 2026 20:38:28 -0700 Subject: [PATCH 3/3] Refactor python command in entrypoint.sh Fix syntax on Python flag and command. --- source/entrypoint.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/entrypoint.sh b/source/entrypoint.sh index 413a061..6f533b9 100644 --- a/source/entrypoint.sh +++ b/source/entrypoint.sh @@ -59,8 +59,8 @@ done if [ -z "$USER_ID" ] || [ -z "$GROUP_ID" ]; then echo "Running container as $USER..." - exec /opt/conda/bin/python main.py \ - --enable-manager + exec python main.py \ + --enable-manager \ --port 8188 \ --listen 0.0.0.0 \ --disable-auto-launch \ @@ -74,8 +74,8 @@ else echo "Running container as comfyui-user ($USER_ID:$GROUP_ID)..." sudo --set-home --preserve-env=PATH --user \#$USER_ID \ - /opt/conda/bin/python main.py \ - --enable-manager + python main.py \ + --enable-manager \ --port 8188 \ --listen 0.0.0.0 \ --disable-auto-launch \