Skip to content

Commit

Permalink
Upgrade to Python 3.11, CUDA 12.1, ROCm 5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
YanWenKun committed Oct 4, 2023
1 parent f56694d commit d60d9ae
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@ LABEL maintainer="code@yanwk.fun"
RUN --mount=type=cache,target=/var/cache/zypp \
set -eu \
&& zypper install --no-confirm \
python310 python310-pip \
python311 python311-pip \
python311-wheel python311-setuptools python311-numpy \
shadow git aria2 \
Mesa-libGL1

# Install PyTorch nightly
RUN --mount=type=cache,target=/root/.cache/pip \
pip install wheel setuptools numpy \
&& pip install --pre torch torchvision \
--index-url https://download.pytorch.org/whl/nightly/cu118
pip install --break-system-packages --pre torch torchvision \
--index-url https://download.pytorch.org/whl/nightly/cu121

# Install pre-release xFormers
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --pre xformers
pip install --break-system-packages --pre xformers

# Deps for main app
RUN --mount=type=cache,target=/root/.cache/pip \
pip install -r https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/requirements.txt
pip install --break-system-packages -r https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/requirements.txt

# Deps for ControlNet Preprocessors
# Deps for ControlNet Auxiliary Preprocessors
RUN --mount=type=cache,target=/root/.cache/pip \
pip install -r https://raw.githubusercontent.com/Fannovel16/comfy_controlnet_preprocessors/main/requirements.txt \
--extra-index-url https://download.pytorch.org/whl/nightly/cu118
pip install --break-system-packages -r https://raw.githubusercontent.com/Fannovel16/comfyui_controlnet_aux/main/requirements.txt \
--extra-index-url https://download.pytorch.org/whl/nightly/cu121

# Fix for CuDNN
WORKDIR /usr/lib64/python3.10/site-packages/torch/lib
RUN ln -s libnvrtc-672ee683.so.11.2 libnvrtc.so
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib64/python3.10/site-packages/torch/lib"
WORKDIR /usr/lib64/python3.11/site-packages/torch/lib
RUN ln -s libnvrtc-b51b459d.so.12 libnvrtc.so
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib64/python3.11/site-packages/torch/lib"

# Create a low-privilege user.
RUN printf 'CREATE_MAIL_SPOOL=no' > /etc/default/useradd \
Expand Down
16 changes: 8 additions & 8 deletions Dockerfile-rocm
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ LABEL maintainer="code@yanwk.fun"
RUN --mount=type=cache,target=/var/cache/zypp \
set -eu \
&& zypper install --no-confirm \
python310 python310-pip \
python311 python311-pip \
python311-wheel python311-setuptools python311-numpy \
shadow git aria2 \
Mesa-libGL1

# Install PyTorch nightly
RUN --mount=type=cache,target=/root/.cache/pip \
pip install wheel setuptools numpy \
&& pip install --pre torch torchvision \
--index-url https://download.pytorch.org/whl/nightly/rocm5.4.2
pip install --break-system-packages --pre torch torchvision \
--index-url https://download.pytorch.org/whl/nightly/rocm5.7

# Deps for main app
RUN --mount=type=cache,target=/root/.cache/pip \
pip install -r https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/requirements.txt
pip install --break-system-packages -r https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/requirements.txt

# Deps for ControlNet Preprocessors
# Deps for ControlNet Auxiliary Preprocessors
RUN --mount=type=cache,target=/root/.cache/pip \
pip install -r https://raw.githubusercontent.com/Fannovel16/comfy_controlnet_preprocessors/main/requirements.txt \
--extra-index-url https://download.pytorch.org/whl/nightly/rocm5.4.2
pip install --break-system-packages -r https://raw.githubusercontent.com/Fannovel16/comfyui_controlnet_aux/main/requirements.txt \
--extra-index-url https://download.pytorch.org/whl/nightly/rocm5.7

# Create a low-privilege user.
RUN printf 'CREATE_MAIL_SPOOL=no' > /etc/default/useradd \
Expand Down
6 changes: 3 additions & 3 deletions scripts/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ git clone --depth=1 --no-tags --recurse-submodules --shallow-submodules \
https://github.com/comfyanonymous/ComfyUI.git \
|| (cd /home/runner/ComfyUI && git pull)

# Controlnet Preprocessor nodes by Fannovel16
# ControlNet Auxiliary Preprocessors by Fannovel16
cd /home/runner/ComfyUI/custom_nodes
git clone --depth=1 --no-tags --recurse-submodules --shallow-submodules \
https://github.com/Fannovel16/comfy_controlnet_preprocessors \
|| (cd /home/runner/ComfyUI/custom_nodes/comfy_controlnet_preprocessors && git pull)
https://github.com/Fannovel16/comfyui_controlnet_aux.git \
|| (cd /home/runner/ComfyUI/custom_nodes/comfyui_controlnet_aux && git pull)

cd /home/runner/ComfyUI
aria2c --allow-overwrite=false --auto-file-renaming=false --continue=true \
Expand Down
2 changes: 1 addition & 1 deletion scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ echo "########################################"

cd /home/runner/ComfyUI

python3.10 main.py --listen --port 8188 ${CLI_ARGS}
python3 main.py --listen --port 8188 ${CLI_ARGS}

0 comments on commit d60d9ae

Please sign in to comment.