Defter77 commited on
Commit
126161d
·
verified ·
1 Parent(s): 415b456

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -8
Dockerfile CHANGED
@@ -23,16 +23,19 @@ RUN git lfs install
23
  RUN git clone --depth 1 https://github.com/comfyanonymous/ComfyUI.git
24
 
25
  # Clone custom nodes with shallow cloning to reduce download size and avoid rate limits
 
26
  RUN git clone --depth 1 https://github.com/cubiq/ComfyUI_IPAdapter_plus.git /app/ComfyUI/custom_nodes/IPAdapter_plus || echo "Failed to clone IPAdapter_plus but continuing" && \
27
  git clone --depth 1 https://github.com/Kosinkadink/ComfyUI-KJNodes.git /app/ComfyUI/custom_nodes/KJNodes || echo "Failed to clone KJNodes but continuing" && \
28
  git clone --depth 1 https://github.com/SSitu/ComfyUI_UltimateSDUpscale.git /app/ComfyUI/custom_nodes/UltimateSDUpscale || echo "Failed to clone UltimateSDUpscale but continuing" && \
29
- git clone --depth 1 https://github.com/ltdrdata/PuLID_ComfyUI.git /app/ComfyUI/custom_nodes/PuLID || echo "Failed to clone PuLID but continuing" && \
30
  git clone --depth 1 https://github.com/cg196/ComfyUI-UseEverywhere.git /app/ComfyUI/custom_nodes/UseEverywhere || echo "Failed to clone UseEverywhere but continuing" && \
31
  git clone --depth 1 https://github.com/melMass/comfy-mtb.git /app/ComfyUI/custom_nodes/mtb || echo "Failed to clone mtb but continuing" && \
32
  git clone --depth 1 https://github.com/LucianoCirino/ComfyUI_Masquerade.git /app/ComfyUI/custom_nodes/Masquerade || echo "Failed to clone Masquerade but continuing" && \
33
  git clone --depth 1 https://github.com/Fannovel16/comfyui-save-image-with-geninfo.git /app/ComfyUI/custom_nodes/SaveGenInfo || echo "Failed to clone SaveGenInfo but continuing" && \
34
  git clone --depth 1 https://github.com/jamesWalker55/comfyui-various.git /app/ComfyUI/custom_nodes/Various || echo "Failed to clone Various but continuing"
35
 
 
 
 
36
  # Create necessary directories
37
  RUN mkdir -p /app/ComfyUI/models/checkpoints \
38
  /app/ComfyUI/models/controlnet \
@@ -42,11 +45,23 @@ RUN mkdir -p /app/ComfyUI/models/checkpoints \
42
  /app/ComfyUI/input \
43
  /app/ComfyUI/output \
44
  /app/workflows \
45
- /tmp/comfyui_user
 
 
 
 
 
 
46
 
47
  # Set permissions for directories that need write access
48
  RUN chmod -R 777 /app/ComfyUI/output \
49
- /tmp/comfyui_user
 
 
 
 
 
 
50
 
51
  # Copy all required application files
52
  COPY requirements.txt .
@@ -54,11 +69,12 @@ COPY app.py .
54
  COPY start.sh .
55
  COPY download_models.py .
56
 
57
- # Try to copy workflow files - if these fail, they'll be downloaded by start.sh
 
58
  COPY workflows/ /app/workflows/
59
 
60
- # Instead of trying to copy LFS files in the Dockerfile, we'll let start.sh handle downloading them
61
- # This ensures we always get the complete files rather than LFS pointers
62
 
63
  # Make scripts executable
64
  RUN chmod +x /app/start.sh
@@ -66,8 +82,8 @@ RUN chmod +x /app/start.sh
66
  # Install Python dependencies
67
  RUN pip3 install --no-cache-dir -r requirements.txt
68
 
69
- # Run model download script
70
- RUN python3 download_models.py || true
71
 
72
  # Expose ports for Gradio and ComfyUI
73
  EXPOSE 7860 8188
 
23
  RUN git clone --depth 1 https://github.com/comfyanonymous/ComfyUI.git
24
 
25
  # Clone custom nodes with shallow cloning to reduce download size and avoid rate limits
26
+ # Note: PuLID is now handled separately via COPY instead of git clone
27
  RUN git clone --depth 1 https://github.com/cubiq/ComfyUI_IPAdapter_plus.git /app/ComfyUI/custom_nodes/IPAdapter_plus || echo "Failed to clone IPAdapter_plus but continuing" && \
28
  git clone --depth 1 https://github.com/Kosinkadink/ComfyUI-KJNodes.git /app/ComfyUI/custom_nodes/KJNodes || echo "Failed to clone KJNodes but continuing" && \
29
  git clone --depth 1 https://github.com/SSitu/ComfyUI_UltimateSDUpscale.git /app/ComfyUI/custom_nodes/UltimateSDUpscale || echo "Failed to clone UltimateSDUpscale but continuing" && \
 
30
  git clone --depth 1 https://github.com/cg196/ComfyUI-UseEverywhere.git /app/ComfyUI/custom_nodes/UseEverywhere || echo "Failed to clone UseEverywhere but continuing" && \
31
  git clone --depth 1 https://github.com/melMass/comfy-mtb.git /app/ComfyUI/custom_nodes/mtb || echo "Failed to clone mtb but continuing" && \
32
  git clone --depth 1 https://github.com/LucianoCirino/ComfyUI_Masquerade.git /app/ComfyUI/custom_nodes/Masquerade || echo "Failed to clone Masquerade but continuing" && \
33
  git clone --depth 1 https://github.com/Fannovel16/comfyui-save-image-with-geninfo.git /app/ComfyUI/custom_nodes/SaveGenInfo || echo "Failed to clone SaveGenInfo but continuing" && \
34
  git clone --depth 1 https://github.com/jamesWalker55/comfyui-various.git /app/ComfyUI/custom_nodes/Various || echo "Failed to clone Various but continuing"
35
 
36
+ # Create directories for PuLID custom node
37
+ RUN mkdir -p /app/ComfyUI/custom_nodes/PuLID
38
+
39
  # Create necessary directories
40
  RUN mkdir -p /app/ComfyUI/models/checkpoints \
41
  /app/ComfyUI/models/controlnet \
 
45
  /app/ComfyUI/input \
46
  /app/ComfyUI/output \
47
  /app/workflows \
48
+ /tmp/comfyui_user \
49
+ /tmp/comfyui_input \
50
+ /tmp/comfyui_output \
51
+ /tmp/comfyui_temp \
52
+ /tmp/workflows \
53
+ /tmp/comfyui_models \
54
+ /tmp/comfyui_models/pulid
55
 
56
  # Set permissions for directories that need write access
57
  RUN chmod -R 777 /app/ComfyUI/output \
58
+ /tmp/comfyui_user \
59
+ /tmp/comfyui_input \
60
+ /tmp/comfyui_output \
61
+ /tmp/comfyui_temp \
62
+ /tmp/workflows \
63
+ /tmp/comfyui_models \
64
+ || echo "Failed to set permissions, continuing anyway"
65
 
66
  # Copy all required application files
67
  COPY requirements.txt .
 
69
  COPY start.sh .
70
  COPY download_models.py .
71
 
72
+ # Copy workflows if they exist, otherwise they'll be downloaded in start.sh
73
+ # Use a proper directory path with a trailing slash
74
  COPY workflows/ /app/workflows/
75
 
76
+ # Initialize the PuLID directory - the actual content will be downloaded from Hugging Face
77
+ RUN echo "PuLID nodes will be downloaded at runtime" > /app/ComfyUI/custom_nodes/PuLID/README.txt
78
 
79
  # Make scripts executable
80
  RUN chmod +x /app/start.sh
 
82
  # Install Python dependencies
83
  RUN pip3 install --no-cache-dir -r requirements.txt
84
 
85
+ # Run model download script (will be overridden at runtime)
86
+ RUN python3 download_models.py || echo "Initial model download failed, will retry at runtime"
87
 
88
  # Expose ports for Gradio and ComfyUI
89
  EXPOSE 7860 8188