download some custom nodes i usually need

This commit is contained in:
owl 2024-10-22 03:36:39 +07:00
parent 5039d28022
commit 623ba5db99
6 changed files with 58 additions and 4 deletions

View File

@ -16,8 +16,10 @@ VOLUME [ \
"/ComfyUI/models", \ "/ComfyUI/models", \
"/ComfyUI/input", \ "/ComfyUI/input", \
"/ComfyUI/output", \ "/ComfyUI/output", \
"/ComfyUI/custom_nodes" \ "/ComfyUI/custom_nodes", \
] "/ComfyUI/my_workflows", \
"/ComfyUI_temp" \
]
RUN pip3 install --upgrade pip \ RUN pip3 install --upgrade pip \
&& pip3 install -r requirements.txt && pip3 install -r requirements.txt
@ -29,6 +31,9 @@ COPY ./cmd.sh /
RUN chmod +x /cmd.sh RUN chmod +x /cmd.sh
COPY ./nodes_download.bash /
RUN bash /nodes_download.bash
RUN cp -TR "/ComfyUI/models" /tmp_models RUN cp -TR "/ComfyUI/models" /tmp_models
RUN cp -TR "/ComfyUI/input" /tmp_input RUN cp -TR "/ComfyUI/input" /tmp_input

View File

@ -3,5 +3,6 @@
Dockerfile for ComfyUI Dockerfile for ComfyUI
No automatic downloads of terabytes of models, no manager, no custom nodes, no nothing. It's just comfy. No automatic downloads of terabytes of models, no manager, no custom nodes, no nothing. It's just comfy.
(I lied, there are some custom nodes defined in nodes_download.bash, you can delete them if you wish so)
Only works on nvidia (container uses cuda 12.6.1), for the sake of simplicity and because i have no other gpus. Only works on nvidia (container uses cuda 12.6.1), for the sake of simplicity and because i have no other gpus.

10
cmd.sh
View File

@ -5,4 +5,12 @@ cp -r --update /tmp_input/* /ComfyUI/input
cp -r --update /tmp_output/* /ComfyUI/output cp -r --update /tmp_output/* /ComfyUI/output
cp -r --update /tmp_custom_nodes/* /ComfyUI/custom_nodes cp -r --update /tmp_custom_nodes/* /ComfyUI/custom_nodes
python3 /ComfyUI/main.py --listen chown -R 1000:1000 /ComfyUI/models
chown -R 1000:1000 /ComfyUI/input
chown -R 1000:1000 /ComfyUI/output
chown -R 1000:1000 /ComfyUI/custom_nodes
chown -R 1000:1000 /ComfyUI/my_workflows
chown -R 1000:1000 /ComfyUI_temp
python3 /ComfyUI/main.py --listen --temp-directory /ComfyUI_temp

0
comfyui.log Normal file
View File

View File

@ -10,6 +10,9 @@ services:
- ./custom_nodes/:/ComfyUI/custom_nodes/ - ./custom_nodes/:/ComfyUI/custom_nodes/
- ./output:/ComfyUI/output - ./output:/ComfyUI/output
- ./input:/ComfyUI/input - ./input:/ComfyUI/input
- ./my_workflows:/ComfyUI/my_workflows
- ./ComfyUI_temp:/ComfyUI_temp
- ./comfyui.log:/ComfyUI/comfyui.log
environment: environment:
- NVIDIA_VISIBLE_DEVICES=all - NVIDIA_VISIBLE_DEVICES=all

37
nodes_download.bash Normal file
View File

@ -0,0 +1,37 @@
#!/bin/bash
export PIP_ROOT_USER_ACTION=ignore
# The list of nodes
NODES=(
"https://github.com/ciri/comfyui-model-downloader.git comfyui-model-downloader"
"https://github.com/11cafe/comfyui-workspace-manager.git comfyui-workspace-manager"
"https://github.com/ltdrdata/ComfyUI-Manager.git ComfyUI-Manager"
)
# Node install function
clone_and_install() {
cd /ComfyUI/custom_nodes
for repo in "${NODES[@]}"; do
url=$(echo "$repo" | cut -d' ' -f1)
name=$(echo "$repo" | cut -d' ' -f2)
if [ ! -d "$name" ] || [ -z "$(ls -A "$name")" ]; then
echo "Cloning $name..."
git clone "$url" "$name"
if [ -f "$name/requirements.txt" ]; then
echo "Installing requirements for $name..."
cd "$name"
pip install -r requirements.txt
cd ..
fi
else
echo "Skipping $name, folder is not empty or already exists."
fi
done
}
clone_and_install