Skip to content

Commit

Permalink
'rocm' reduce image size
Browse files Browse the repository at this point in the history
  • Loading branch information
YanWenKun committed Sep 10, 2024
1 parent 3fbdae1 commit f686c49
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 33 deletions.
58 changes: 30 additions & 28 deletions rocm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,43 +53,45 @@ RUN --mount=type=cache,target=/root/.cache/pip \
&& df -h

# Dependencies for frequently-used
# (Do this firstly so PIP won't be solving too many deps at one time)
# Due to GitHub CI's "out of disk space" error, reducing the list.
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --break-system-packages \
-r https://raw.githubusercontent.com/comfyanonymous/ComfyUI/master/requirements.txt \
-r https://raw.githubusercontent.com/crystian/ComfyUI-Crystools/main/requirements.txt \
-r https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/requirements.txt \
-r https://raw.githubusercontent.com/cubiq/ComfyUI_essentials/main/requirements.txt \
-r https://raw.githubusercontent.com/Fannovel16/comfyui_controlnet_aux/main/requirements.txt \
-r https://raw.githubusercontent.com/jags111/efficiency-nodes-comfyui/main/requirements.txt \
-r https://raw.githubusercontent.com/ltdrdata/ComfyUI-Impact-Pack/Main/requirements.txt \
-r https://raw.githubusercontent.com/ltdrdata/ComfyUI-Impact-Subpack/main/requirements.txt \
-r https://raw.githubusercontent.com/ltdrdata/ComfyUI-Inspire-Pack/main/requirements.txt \
-r https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/requirements.txt \
--extra-index-url https://download.pytorch.org/whl/nightly/rocm6.2

# Dependencies for more, with few hand-pick:
# 'compel lark' for smZNodes
# 'torchdiffeq' for DepthFM
# 'fairscale' for APISR
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --break-system-packages \
-r https://raw.githubusercontent.com/cubiq/ComfyUI_FaceAnalysis/main/requirements.txt \
-r https://raw.githubusercontent.com/cubiq/ComfyUI_InstantID/main/requirements.txt \
-r https://raw.githubusercontent.com/Fannovel16/ComfyUI-Frame-Interpolation/main/requirements-no-cupy.txt \
-r https://raw.githubusercontent.com/FizzleDorf/ComfyUI_FizzNodes/main/requirements.txt \
-r https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/main/requirements.txt \
-r https://raw.githubusercontent.com/melMass/comfy_mtb/main/requirements.txt \
-r https://raw.githubusercontent.com/storyicon/comfyui_segment_anything/main/requirements.txt \
-r https://raw.githubusercontent.com/ZHO-ZHO-ZHO/ComfyUI-InstantID/main/requirements.txt \
compel lark torchdiffeq fairscale \
python-ffmpeg \
--extra-index-url https://download.pytorch.org/whl/nightly/rocm6.2
# When you build your own image, you can uncomment the code blocks below.

# Fix MediaPipe's broken dep (protobuf<4).
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --break-system-packages \
mediapipe \
&& pip list
# # Dependencies for more, with few hand-pick:
# # 'compel lark' for smZNodes
# # 'torchdiffeq' for DepthFM
# # 'fairscale' for APISR
# RUN --mount=type=cache,target=/root/.cache/pip \
# pip install --break-system-packages \
# -r https://raw.githubusercontent.com/crystian/ComfyUI-Crystools/main/requirements.txt \
# -r https://raw.githubusercontent.com/cubiq/ComfyUI_FaceAnalysis/main/requirements.txt \
# -r https://raw.githubusercontent.com/cubiq/ComfyUI_InstantID/main/requirements.txt \
# -r https://raw.githubusercontent.com/Fannovel16/ComfyUI-Frame-Interpolation/main/requirements-no-cupy.txt \
# -r https://raw.githubusercontent.com/FizzleDorf/ComfyUI_FizzNodes/main/requirements.txt \
# -r https://raw.githubusercontent.com/kijai/ComfyUI-KJNodes/main/requirements.txt \
# -r https://raw.githubusercontent.com/ltdrdata/ComfyUI-Impact-Pack/Main/requirements.txt \
# -r https://raw.githubusercontent.com/ltdrdata/ComfyUI-Impact-Subpack/main/requirements.txt \
# -r https://raw.githubusercontent.com/ltdrdata/ComfyUI-Inspire-Pack/main/requirements.txt \
# -r https://raw.githubusercontent.com/melMass/comfy_mtb/main/requirements.txt \
# -r https://raw.githubusercontent.com/storyicon/comfyui_segment_anything/main/requirements.txt \
# -r https://raw.githubusercontent.com/ZHO-ZHO-ZHO/ComfyUI-InstantID/main/requirements.txt \
# compel lark torchdiffeq fairscale \
# python-ffmpeg \
# --extra-index-url https://download.pytorch.org/whl/nightly/rocm6.2

# # Fix MediaPipe's broken dep (protobuf<4).
# RUN --mount=type=cache,target=/root/.cache/pip \
# pip install --break-system-packages \
# mediapipe \
# && pip list

RUN df -h \
&& du -ah /root \
Expand Down
6 changes: 6 additions & 0 deletions rocm/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,9 @@ podman run -it --rm \
----

Once the app is loaded, visit http://localhost:8188/

## Note

Due to GitHub CI error "No space left on device", less Python dependencies were installed, and less Custom Nodes were in the download list.

If you build this image locally, you can uncomment the lines in `Dockerfile` and `download.sh`, so you will have a more all-in-one image.
6 changes: 6 additions & 0 deletions rocm/README.zh.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,9 @@ podman run -it --rm \
----

启动完成后,访问 http://localhost:8188/

## 提示

由于 GitHub CI 总是报错“存储空间不足”,不得已裁剪镜像尺寸,少安装一些 Python 依赖项,因此也少下载若干扩展。

如果你在本地构建本镜像,可以在 `Dockerfile``download.sh` 中将对应代码取消注释,以获得一个更加“全能”的镜像。
3 changes: 3 additions & 0 deletions rocm/runner-scripts/download-models.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ https://huggingface.co/playgroundai/playground-v2.5-1024px-aesthetic/resolve/mai
https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors
dir=vae
out=vae-ft-mse-840000-ema-pruned.safetensors

# TAESD

https://raw.githubusercontent.com/madebyollin/taesd/main/taesd_decoder.pth
dir=vae_approx
out=taesd_decoder.pth
Expand Down
10 changes: 5 additions & 5 deletions rocm/runner-scripts/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ cd /root/ComfyUI/custom_nodes

# Workspace
clone_or_pull https://github.com/AIGODLIKE/AIGODLIKE-ComfyUI-Translation.git
clone_or_pull https://github.com/crystian/ComfyUI-Crystools.git
clone_or_pull https://github.com/crystian/ComfyUI-Crystools-save.git
# clone_or_pull https://github.com/crystian/ComfyUI-Crystools.git
# clone_or_pull https://github.com/crystian/ComfyUI-Crystools-save.git

# General
clone_or_pull https://github.com/chrisgoringe/cg-use-everywhere.git
Expand All @@ -52,12 +52,12 @@ clone_or_pull https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git
clone_or_pull https://github.com/cubiq/ComfyUI_IPAdapter_plus.git
clone_or_pull https://github.com/Fannovel16/comfyui_controlnet_aux.git
clone_or_pull https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet.git
clone_or_pull https://github.com/ltdrdata/ComfyUI-Impact-Pack.git
clone_or_pull https://github.com/ltdrdata/ComfyUI-Inspire-Pack.git
# clone_or_pull https://github.com/ltdrdata/ComfyUI-Impact-Pack.git
# clone_or_pull https://github.com/ltdrdata/ComfyUI-Inspire-Pack.git
clone_or_pull https://github.com/twri/sdxl_prompt_styler.git

# Video
clone_or_pull https://github.com/Fannovel16/ComfyUI-Frame-Interpolation.git
# clone_or_pull https://github.com/Fannovel16/ComfyUI-Frame-Interpolation.git
clone_or_pull https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved.git
clone_or_pull https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git

Expand Down

0 comments on commit f686c49

Please sign in to comment.