Skip to content

Commit dd97e75

Browse files
committed
Allow giving custom --extra-index-url, defaults to CU130
1 parent eb85e04 commit dd97e75

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

Dockerfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,24 @@ USER comfyui
4040
RUN python -m venv .venv
4141
ENV PATH="/comfyui/.venv/bin:$PATH"
4242

43+
# Take PIP_EXTRA_INDEX_URL as a required build argument and bake it into the
44+
# image as an environment variable. This variable is then used to select
45+
# hardware-specific flavors of PyTorch, enabling support for CPU, AMD, and newer
46+
# CUDA inference.
47+
ARG PIP_EXTRA_INDEX_URL
48+
ENV PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}
49+
4350
# Install ComfyUI's Python dependencies. Although dependency keeping is also
4451
# performed at startup, building ComfyUI's base dependencies into the image
4552
# significantly speeds up each containers' first run.
4653
#
4754
# Since this step takes a long time to complete, it's performed early to take
4855
# advantage of Docker's build cache, thereby accelerating subsequent builds.
4956
COPY requirements.txt manager_requirements.txt ./
50-
RUN pip install --no-cache-dir --disable-pip-version-check \
57+
RUN pip install \
58+
--no-cache-dir \
59+
--disable-pip-version-check \
60+
--extra-index-url "${PIP_EXTRA_INDEX_URL}" \
5161
-r requirements.txt
5262

5363
# Install ComfyUI

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,11 @@ For models compatible with Iluvatar Extension for PyTorch. Here's a step-by-step
365365

366366
Start by installing Docker, Docker Compose, and the NVIDIA Container Toolkit on
367367
your host. Next, edit `compose.yaml` and update the `UID` and `GID` variables to
368-
match your user. Additional fields are documented in the file for further
369-
customization.
368+
match your host user's UID and GID. Also ensure that `PIP_EXTRA_INDEX_URL`
369+
points to the recommended non-experimental index URL for your hardware, as
370+
described in the beginning of the [manual installation
371+
section](#manual-install-windows-linux). Additional fields are documented in the
372+
file for further customization.
370373

371374
Once ready, build and run the image locally:
372375

compose.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ services:
88
args:
99
# Declare additional system dependencies for custom nodes
1010
APT_EXTRA_PACKAGES:
11+
# Set the value of the --extra-index-url flag to select a specific CUDA,
12+
# ROCm, or CPU version.
13+
PIP_EXTRA_INDEX_URL: "https://download.pytorch.org/whl/cu130"
1114

1215
ports:
1316
- 8188:8188

entrypoint.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ done
4848
# PIP_EXTRA_PACKAGES.
4949
echo "[entrypoint] Updating Python dependencies..."
5050
su -c "
51-
pip install \\
52-
--no-cache-dir \\
53-
--disable-pip-version-check \\
54-
-r requirements.txt \\
51+
pip install \\
52+
--no-cache-dir \\
53+
--disable-pip-version-check \\
54+
--extra-index-url '$PIP_EXTRA_INDEX_URL' \\
55+
-r requirements.txt \\
5556
$(find custom_nodes -mindepth 2 -maxdepth 2 -type f -name requirements.txt -printf "-r '%p' ") \\
5657
$PIP_EXTRA_PACKAGES
5758
" comfyui \

0 commit comments

Comments
 (0)