Defter77 commited on
Commit
f18f2e5
·
verified ·
1 Parent(s): f29074a

Upload start.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. start.sh +3 -24
start.sh CHANGED
@@ -18,35 +18,14 @@ echo "Starting ComfyUI server..."
18
  python3 main.py --listen 0.0.0.0 --port 8188 &
19
  COMFY_PID=$!
20
 
21
- # Robust check to ensure ComfyUI is actually running
22
  echo "Waiting for ComfyUI server to initialize..."
23
- MAX_RETRIES=30
24
- RETRY_COUNT=0
25
- COMFY_READY=false
26
-
27
- while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
28
- echo "Checking if ComfyUI is ready (attempt $((RETRY_COUNT+1))/$MAX_RETRIES)..."
29
- if curl -s "http://localhost:8188/system_stats" > /dev/null; then
30
- COMFY_READY=true
31
- echo "ComfyUI server is up and running!"
32
- break
33
- fi
34
- RETRY_COUNT=$((RETRY_COUNT+1))
35
- sleep 5
36
- done
37
-
38
- if [ "$COMFY_READY" = false ]; then
39
- echo "WARNING: ComfyUI server didn't respond within the expected time."
40
- echo "The application may not function correctly."
41
- fi
42
-
43
- # Print message about network configuration
44
- echo "ComfyUI should be accessible at: http://0.0.0.0:8188"
45
 
46
  # Start the web interface
47
  cd /app
48
  echo "Starting Gradio interface..."
49
  python3 app.py
50
 
51
- # If the Gradio app crashes, kill ComfyUI too
52
  kill $COMFY_PID
 
18
  python3 main.py --listen 0.0.0.0 --port 8188 &
19
  COMFY_PID=$!
20
 
21
+ # Wait for ComfyUI to start
22
  echo "Waiting for ComfyUI server to initialize..."
23
+ sleep 30 # Give it more time to start
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  # Start the web interface
26
  cd /app
27
  echo "Starting Gradio interface..."
28
  python3 app.py
29
 
30
+ # If the Gradio app exits, kill ComfyUI too
31
  kill $COMFY_PID