Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +27 -11
Dockerfile
CHANGED
|
@@ -1,33 +1,49 @@
|
|
| 1 |
# ----------------------------------------------------
|
| 2 |
# Dockerfile Comfy UI (Mode CPU) - V5 (FIX PORT 7860)
|
|
|
|
|
|
|
| 3 |
# ----------------------------------------------------
|
| 4 |
|
| 5 |
# 1. Image de base
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
WORKDIR /app/ComfyUI
|
| 8 |
|
| 9 |
-
#
|
|
|
|
| 10 |
RUN pip install "numpy<2.0"
|
| 11 |
|
| 12 |
-
# FIX 2 : PyTorch CPU (
|
| 13 |
-
|
| 14 |
RUN pip install torch==2.3.1+cpu torchvision==0.18.1+cpu torchaudio==2.3.1+cpu --index-url https://download.pytorch.org/whl/cpu
|
| 15 |
|
| 16 |
# FIX 3 : Dépendances standards
|
| 17 |
RUN pip install -r requirements.txt
|
| 18 |
|
| 19 |
-
# FIX 4 : Transformers récent
|
| 20 |
-
|
| 21 |
-
RUN pip install transformers==4.41.2
|
| 22 |
|
| 23 |
-
# 5. Téléchargement
|
| 24 |
RUN mkdir -p models/checkpoints \
|
| 25 |
-
&& curl -L "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors" -o ./models/checkpoints/v1-5-pruned-emaonly.safetensors
|
|
|
|
|
|
|
| 26 |
|
| 27 |
# 6. Configuration Hugging Face Space (Port 7860 Obligatoire)
|
| 28 |
ENV PORT 7860
|
| 29 |
EXPOSE 7860
|
| 30 |
|
| 31 |
-
# 7. Lancement (CRITIQUE : PORT 7860)
|
| 32 |
-
# On force ComfyUI à écouter sur le port 7860 au lieu de 8188
|
| 33 |
CMD ["python3", "main.py", "--listen", "0.0.0.0", "--port", "7860", "--cpu"]
|
|
|
|
| 1 |
# ----------------------------------------------------
|
| 2 |
# Dockerfile Comfy UI (Mode CPU) - V5 (FIX PORT 7860)
|
| 3 |
+
# Ce fichier définit l'environnement de votre Hugging Face Space.
|
| 4 |
+
# Il est optimisé pour les instances CPU.
|
| 5 |
# ----------------------------------------------------
|
| 6 |
|
| 7 |
# 1. Image de base
|
| 8 |
+
FROM python:3.11-slim
|
| 9 |
+
|
| 10 |
+
WORKDIR /app
|
| 11 |
+
|
| 12 |
+
# 2. Installation des dépendances système
|
| 13 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 14 |
+
git \
|
| 15 |
+
libglib2.0-0 \
|
| 16 |
+
curl \
|
| 17 |
+
&& apt-get clean \
|
| 18 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 19 |
+
|
| 20 |
+
# 3. Clonage de ComfyUI
|
| 21 |
+
RUN git clone https://github.com/comfyanonymous/ComfyUI.git
|
| 22 |
+
|
| 23 |
WORKDIR /app/ComfyUI
|
| 24 |
|
| 25 |
+
# 4. Installation des dépendances Python
|
| 26 |
+
# FIX 1 : On garde NumPy < 2.0 pour la compatibilité
|
| 27 |
RUN pip install "numpy<2.0"
|
| 28 |
|
| 29 |
+
# FIX 2 : PyTorch CPU (Essentiel pour éviter l'erreur de driver NVIDIA)
|
|
|
|
| 30 |
RUN pip install torch==2.3.1+cpu torchvision==0.18.1+cpu torchaudio==2.3.1+cpu --index-url https://download.pytorch.org/whl/cpu
|
| 31 |
|
| 32 |
# FIX 3 : Dépendances standards
|
| 33 |
RUN pip install -r requirements.txt
|
| 34 |
|
| 35 |
+
# FIX 4 : Transformers récent (avec une version de tokenizers compatible)
|
| 36 |
+
RUN pip install transformers==4.41.2 tokenizers==0.19.1
|
|
|
|
| 37 |
|
| 38 |
+
# 5. Téléchargement des modèles SD 1.5 (CHECKPOINTS)
|
| 39 |
RUN mkdir -p models/checkpoints \
|
| 40 |
+
&& curl -L "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors" -o ./models/checkpoints/v1-5-pruned-emaonly.safetensors \
|
| 41 |
+
&& curl -L "https://civitai.com/api/download/models/126689?type=Model&format=SafeTensor&size=full" -o ./models/checkpoints/dreamshaper_8.safetensors \
|
| 42 |
+
&& curl -L "https://civitai.com/api/download/models/4201?type=Model&format=SafeTensor&size=full&fp16=false" -o ./models/checkpoints/realisticVisionV51_v51VAE.safetensors
|
| 43 |
|
| 44 |
# 6. Configuration Hugging Face Space (Port 7860 Obligatoire)
|
| 45 |
ENV PORT 7860
|
| 46 |
EXPOSE 7860
|
| 47 |
|
| 48 |
+
# 7. Lancement (CRITIQUE : PORT 7860 et mode --cpu)
|
|
|
|
| 49 |
CMD ["python3", "main.py", "--listen", "0.0.0.0", "--port", "7860", "--cpu"]
|