Spaces:
Runtime error
Runtime error
# Base image with Python | |
FROM python:3.10 | |
# Install git and curl (for internet connectivity test) | |
RUN apt-get update && apt-get install -y git curl | |
WORKDIR /home/user/app | |
# Copy all files to the container | |
COPY . . | |
# Test internet connectivity | |
RUN echo "Testing internet connectivity..." && \ | |
curl -Is http://www.github.com | head -n 1 || \ | |
(echo "Internet connectivity test failed. Check network settings." && exit 1) | |
# Clone custom node repositories with retries and debug output | |
RUN echo "Cloning ComfyUI-YoloWorld-EfficientSAM..." && \ | |
for i in 1 2 3; do \ | |
git clone https://github.com/Fannovel16/ComfyUI-YoloWorld-EfficientSAM.git custom_nodes/ComfyUI-YoloWorld-EfficientSAM && break || \ | |
(echo "Attempt $i failed. Retrying..." && sleep 5); \ | |
done || \ | |
(echo "Failed to clone ComfyUI-YoloWorld-EfficientSAM after 3 attempts" && exit 1) | |
RUN echo "Cloning comfyui-inpaint-nodes..." && \ | |
for i in 1 2 3; do \ | |
git clone https://github.com/Acly/comfyui-inpaint-nodes.git custom_nodes/comfyui-inpaint-nodes && break || \ | |
(echo "Attempt $i failed. Retrying..." && sleep 5); \ | |
done || \ | |
(echo "Failed to clone comfyui-inpaint-nodes after 3 attempts" && exit 1) | |
RUN echo "Cloning rgthree-comfy..." && \ | |
for i in 1 2 3; do \ | |
git clone https://github.com/rgthree/rgthree-comfy.git custom_nodes/rgthree-comfy && break || \ | |
(echo "Attempt $i failed. Retrying..." && sleep 5); \ | |
done || \ | |
(echo "Failed to clone rgthree-comfy after 3 attempts" && exit 1) | |
# List contents of custom_nodes/ for debugging | |
RUN echo "Contents of custom_nodes/:" && \ | |
ls -la custom_nodes/ && \ | |
echo "Contents of ComfyUI-YoloWorld-EfficientSAM:" && \ | |
ls -la custom_nodes/ComfyUI-YoloWorld-EfficientSAM || echo "ComfyUI-YoloWorld-EfficientSAM not found" && \ | |
echo "Contents of comfyui-inpaint-nodes:" && \ | |
ls -la custom_nodes/comfyui-inpaint-nodes || echo "comfyui-inpaint-nodes not found" && \ | |
echo "Contents of rgthree-comfy:" && \ | |
ls -la custom_nodes/rgthree-comfy || echo "rgthree-comfy not found" | |
# Install dependencies for custom nodes (if they have requirements.txt) | |
RUN if [ -f "custom_nodes/ComfyUI-YoloWorld-EfficientSAM/requirements.txt" ]; then \ | |
echo "Installing dependencies for ComfyUI-YoloWorld-EfficientSAM..." && \ | |
pip install -r custom_nodes/ComfyUI-YoloWorld-EfficientSAM/requirements.txt || \ | |
echo "Failed to install dependencies for ComfyUI-YoloWorld-EfficientSAM"; \ | |
else \ | |
echo "No requirements.txt found for ComfyUI-YoloWorld-EfficientSAM"; \ | |
fi | |
RUN if [ -f "custom_nodes/comfyui-inpaint-nodes/requirements.txt" ]; then \ | |
echo "Installing dependencies for comfyui-inpaint-nodes..." && \ | |
pip install -r custom_nodes/comfyui-inpaint-nodes/requirements.txt || \ | |
echo "Failed to install dependencies for comfyui-inpaint-nodes"; \ | |
else \ | |
echo "No requirements.txt found for comfyui-inpaint-nodes"; \ | |
fi | |
RUN if [ -f "custom_nodes/rgthree-comfy/requirements.txt" ]; then \ | |
echo "Installing dependencies for rgthree-comfy..." && \ | |
pip install -r custom_nodes/rgthree-comfy/requirements.txt || \ | |
echo "Failed to install dependencies for rgthree-comfy"; \ | |
else \ | |
echo "No requirements.txt found for rgthree-comfy"; \ | |
fi | |
# Install additional dependencies for ComfyUI-YoloWorld-EfficientSAM | |
RUN pip install efficient-sam | |
# Install dependencies | |
RUN pip install --no-cache-dir --upgrade pip | |
RUN pip install "inference[transformers,sam,clip,gaze,grounding-dino,yolo-world]" xformers torchvision torchaudio supervision onnxruntime onnxruntime-gpu --extra-index-url https://download.pytorch.org/whl/cu124 | |
RUN pip install -r requirements.txt | |
RUN pip install aiohttp==3.10.11 | |
# Expose the port Gradio runs on | |
EXPOSE 7860 | |
# Command to run the app | |
CMD ["python", "app.py"] |