mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-13 13:47:12 +08:00
20 lines
732 B
Bash
20 lines
732 B
Bash
#!/usr/bin/env bash
|
|
|
|
# Use libtcmalloc for better memory management
|
|
TCMALLOC="$(ldconfig -p | grep -Po "libtcmalloc.so.\d" | head -n 1)"
|
|
export LD_PRELOAD="${TCMALLOC}"
|
|
|
|
# Serve the API and don't shutdown the container
|
|
if [ "$SERVE_API_LOCALLY" == "true" ]; then
|
|
echo "runpod-worker-comfy: Starting ComfyUI"
|
|
python3 /comfyui/main.py --disable-auto-launch --disable-metadata --listen &
|
|
|
|
echo "runpod-worker-comfy: Starting RunPod Handler"
|
|
python3 -u /rp_handler.py --rp_serve_api --rp_api_host=0.0.0.0
|
|
else
|
|
echo "runpod-worker-comfy: Starting ComfyUI"
|
|
python3 /comfyui/main.py --disable-auto-launch --disable-metadata &
|
|
|
|
echo "runpod-worker-comfy: Starting RunPod Handler"
|
|
python3 -u /rp_handler.py
|
|
fi |