Always update Python dependencies + don't hide pip logs

This commit is contained in:
B. Bergeron 2026-01-10 17:54:25 -05:00
parent 6c9110564b
commit c804c0c12e
No known key found for this signature in database
GPG Key ID: 20A0A88F22238925

View File

@ -38,37 +38,19 @@ for dev in /dev/nvidia*; do
usermod -aG "$group" "$user" usermod -aG "$group" "$user"
done done
# Install or update the Python dependencies defined by ComfyUI (or any installed
# Install packages listed in ./requirements.txt, requirement files under # custom node) and also install any user-defined dependencies specified in
# ./custom_nodes, and any specified in PIP_EXTRA_PACKAGES. Also store a hash of # PIP_EXTRA_PACKAGES.
# all dependencies to detect when new or updated packages need to be installed. echo "[entrypoint] Updating Python dependencies..."
packages_hash_file="/home/comfyui/pkghash" su -c "
pip install \\
packages_comfyui=$(cat requirements.txt) --no-cache-dir \\
packages_custom=$(find custom_nodes -name requirements.txt -exec cat {} \;) --disable-pip-version-check \\
packages_extras=$(echo "$PIP_EXTRA_PACKAGES" | tr ' ' '\n') -r requirements.txt \\
$(find custom_nodes -mindepth 2 -maxdepth 2 -type f -name requirements.txt -printf "-r '%p' ") \\
current_hash=$( $PIP_EXTRA_PACKAGES
{ " comfyui \
echo "$packages_comfyui" || echo "[entrypoint] Failed to install dependencies, starting anyway" >&2
echo "$packages_custom"
echo "$packages_extras"
} | sort | sha256sum | awk '{print $1}'
)
if [ ! -f "$packages_hash_file" ] || [ "$current_hash" != "$(cat $packages_hash_file)" ]; then
echo "[entrypoint] Installing new python dependencies, this might take a while..."
reqs="-r requirements.txt"
for req in custom_nodes/*/requirements.txt; do
[ -f "$req" ] && reqs="$reqs -r $req"
done
su -c "pip install -q --disable-pip-version-check --no-cache-dir $reqs $PIP_EXTRA_PACKAGES" comfyui
echo "$current_hash" > "$packages_hash_file"
else
echo "[entrypoint] Requirements unchanged, skipping install"
fi
# Run command as comfyui # Run command as comfyui
echo "[entrypoint] Running command" echo "[entrypoint] Running command"