fix: use venv Python directly instead of source activation

- Change from 'source venv/bin/activate' to direct venv/bin/python execution
- Use exec to replace shell process with Python process
- Fixes issue where supervisor doesn't properly activate venv
- Ensures all extension dependencies are available
This commit is contained in:
2025-11-23 08:38:14 +01:00
parent ce14193222
commit 4b4c23d16e

View File

@@ -16,20 +16,22 @@ export TQDM_DISABLE=1
# Navigate to ComfyUI directory # Navigate to ComfyUI directory
cd "${COMFYUI_DIR}" || exit 1 cd "${COMFYUI_DIR}" || exit 1
# Activate virtual environment # Determine which Python to use
if [ -d "venv" ]; then if [ -f "venv/bin/python" ]; then
echo "Activating ComfyUI virtual environment..." PYTHON_BIN="venv/bin/python"
source venv/bin/activate echo "Using ComfyUI virtual environment Python..."
else else
PYTHON_BIN="python3"
echo "WARNING: venv not found, using system Python" echo "WARNING: venv not found, using system Python"
fi fi
echo "Starting ComfyUI on port 8188..." echo "Starting ComfyUI on port 8188..."
echo "Access at: http://localhost:8188" echo "Access at: http://localhost:8188"
echo "Using HuggingFace cache: ${HF_CACHE}" echo "Using HuggingFace cache: ${HF_CACHE}"
echo "Python: ${PYTHON_BIN}"
# Start ComfyUI with GPU support # Start ComfyUI with GPU support
python main.py \ exec "${PYTHON_BIN}" main.py \
--listen 0.0.0.0 \ --listen 0.0.0.0 \
--port 8188 \ --port 8188 \
--enable-cors-header \ --enable-cors-header \