[add] comfy xpu

This commit is contained in:
Andy Bunce 2025-12-13 11:04:32 +00:00
parent 2d0fd54f68
commit e0c302bcdd
13 changed files with 646 additions and 0 deletions

View file

@ -0,0 +1,62 @@
#!/bin/bash
set -e
echo "########################################"
# Run user's set-proxy script
cd /root
if [ ! -f "/root/user-scripts/set-proxy.sh" ] ; then
mkdir -p /root/user-scripts
cp /runner-scripts/set-proxy.sh.example /root/user-scripts/set-proxy.sh
else
echo "[INFO] Running set-proxy script..."
chmod +x /root/user-scripts/set-proxy.sh
source /root/user-scripts/set-proxy.sh
fi ;
# Copy ComfyUI from cache to workdir if it doesn't exist
cd /root
if [ ! -f "/root/ComfyUI/main.py" ] ; then
mkdir -p /root/ComfyUI
# 'cp --archive': all file timestamps and permissions will be preserved
# 'cp --update=none': do not overwrite
if cp --archive --update=none "/default-comfyui-bundle/ComfyUI/." "/root/ComfyUI/" ; then
echo "[INFO] Setting up ComfyUI..."
echo "[INFO] Using image-bundled ComfyUI (copied to workdir)."
else
echo "[ERROR] Failed to copy ComfyUI bundle to '/root/ComfyUI'" >&2
exit 1
fi
else
echo "[INFO] Using existing ComfyUI in user storage..."
fi
# Run user's pre-start script
cd /root
if [ ! -f "/root/user-scripts/pre-start.sh" ] ; then
mkdir -p /root/user-scripts
cp /runner-scripts/pre-start.sh.example /root/user-scripts/pre-start.sh
else
echo "[INFO] Running pre-start script..."
chmod +x /root/user-scripts/pre-start.sh
source /root/user-scripts/pre-start.sh
fi ;
echo "[INFO] Starting ComfyUI..."
echo "########################################"
# Let .pyc files be stored in one place
export PYTHONPYCACHEPREFIX="/root/.cache/pycache"
# Let PIP install packages to /root/.local
export PIP_USER=true
# Add above to PATH
export PATH="${PATH}:/root/.local/bin"
# Suppress [WARNING: Running pip as the 'root' user]
export PIP_ROOT_USER_ACTION=ignore
cd /root
python3 ./ComfyUI/main.py --listen --port 8188 --enable-manager ${CLI_ARGS}

View file

@ -0,0 +1,4 @@
#!/bin/bash
set -eu
echo "[INFO] Continue without pre-start script."

View file

@ -0,0 +1,22 @@
#!/bin/bash
set -eu
# Tip: Within containers, you cannot access your host machine via 127.0.0.1.
# You will need "host.docker.internal"(for Docker) or "host.containers.internal"(for Podman)
# Example of setting proxy
#export HTTP_PROXY=http://host.docker.internal:1081
#export HTTPS_PROXY=$HTTP_PROXY
#export http_proxy=$HTTP_PROXY
#export https_proxy=$HTTP_PROXY
#export NO_PROXY="localhost,*.local,*.internal,[::1],fd00::/7,
#10.0.0.0/8,127.0.0.0/8,169.254.0.0/16,172.16.0.0/12,192.168.0.0/16,
#10.*,127.*,169.254.*,172.16.*,172.17.*,172.18.*,172.19.*,172.20.*,
#172.21.*,172.22.*,172.23.*,172.24.*,172.25.*,172.26.*,172.27.*,
#172.28.*,172.29.*,172.30.*,172.31.*,172.32.*,192.168.*,
#*.cn,ghproxy.com,*.ghproxy.com,ghproxy.org,*.ghproxy.org,
#gh-proxy.com,*.gh-proxy.com,ghproxy.net,*.ghproxy.net"
#export no_proxy=$NO_PROXY
#echo "[INFO] Proxy set to $HTTP_PROXY"
echo "[INFO] Continue without proxy."