Download entrypoint.sh from X-HighVoltage-X/Expression-Editor: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/spaces/X-HighVoltage-X/Expression-Editor/resolve/main/entrypoint.sh
- Command line
-
hf download hf://spaces/X-HighVoltage-X/Expression-Editor/entrypoint.sh
-
curl -L -o entrypoint.sh https://huggingface.co/spaces/X-HighVoltage-X/Expression-Editor/resolve/main/entrypoint.sh
1.05 kB
| # Using 127.0.0.1 for internal process communication | |
| ARGS="--listen 127.0.0.1 --port 8188 --cpu" | |
| # This checks if USE_PERSISTENT_DATA is enabled and the /data directory exists | |
| case "$USE_PERSISTENT_DATA" in | |
| true|1|yes) | |
| if [ -d "/data" ]; then | |
| echo "Directory /data detected. Enabling output persistence." | |
| ARGS="$ARGS --output-directory /data/" | |
| fi | |
| ;; | |
| esac | |
| # Start ComfyUI in the background | |
| echo "Starting ComfyUI with arguments: $ARGS" | |
| python main.py $ARGS & | |
| # Wait for ComfyUI to be ready (Port 8188) | |
| # This prevents the "Connection Refused" error in your app.py | |
| echo "Waiting for ComfyUI to respond on port 8188..." | |
| while ! nc -z 127.0.0.1 8188; do | |
| sleep 2 | |
| done | |
| echo "ComfyUI engine is ready." | |
| # Start the main application (Gradio/UI) | |
| # Hugging Face requires this app to listen on the port specified in the $PORT variable. | |
| # 'exec' ensures the app receives termination signals properly. | |
| echo "Starting app.py on port ${PORT:-7860}..." | |
| exec python app.py --port ${PORT:-7860} |