File size: 3,896 Bytes
1595096
 
 
3b2789c
 
1595096
965759d
 
1595096
 
 
3b2789c
 
 
 
 
 
1469317
3b2789c
 
 
 
 
1469317
 
3b2789c
 
 
 
 
1469317
 
3b2789c
 
 
 
 
1469317
 
 
 
 
 
 
 
 
 
98cb2c7
 
1469317
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98cb2c7
1595096
 
 
 
 
 
 
 
 
 
98cb2c7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# 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"]