Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +12 -8
Dockerfile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# ----------------------------------------------------
|
| 2 |
-
# Dockerfile Comfy UI (Mode CPU) -
|
| 3 |
# Ce fichier définit l'environnement de votre Hugging Face Space.
|
| 4 |
# Il est optimisé pour les instances CPU.
|
| 5 |
# ----------------------------------------------------
|
|
@@ -10,6 +10,7 @@ FROM python:3.11-slim
|
|
| 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 \
|
|
@@ -22,17 +23,14 @@ 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 :
|
| 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)
|
|
@@ -41,6 +39,12 @@ RUN mkdir -p models/checkpoints \
|
|
| 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
|
|
|
|
| 1 |
# ----------------------------------------------------
|
| 2 |
+
# Dockerfile Comfy UI (Mode CPU) - V6 (FINAL)
|
| 3 |
# Ce fichier définit l'environnement de votre Hugging Face Space.
|
| 4 |
# Il est optimisé pour les instances CPU.
|
| 5 |
# ----------------------------------------------------
|
|
|
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
# 2. Installation des dépendances système
|
| 13 |
+
# git pour le clonage, libglib2.0-0 pour Pillow/Torch, curl pour les téléchargements
|
| 14 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 15 |
git \
|
| 16 |
libglib2.0-0 \
|
|
|
|
| 23 |
|
| 24 |
WORKDIR /app/ComfyUI
|
| 25 |
|
| 26 |
+
# 4. Installation des dépendances Python (Mode CPU)
|
| 27 |
+
# FIX 1 : NumPy pour la compatibilité
|
| 28 |
RUN pip install "numpy<2.0"
|
| 29 |
+
# FIX 2 : PyTorch CPU pour éviter l'erreur de driver
|
|
|
|
| 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 |
# FIX 3 : Dépendances standards
|
| 32 |
RUN pip install -r requirements.txt
|
| 33 |
+
# FIX 4 : Transformers récent pour les encodeurs de texte
|
|
|
|
| 34 |
RUN pip install transformers==4.41.2 tokenizers==0.19.1
|
| 35 |
|
| 36 |
# 5. Téléchargement des modèles SD 1.5 (CHECKPOINTS)
|
|
|
|
| 39 |
&& curl -L "https://civitai.com/api/download/models/126689?type=Model&format=SafeTensor&size=full" -o ./models/checkpoints/dreamshaper_8.safetensors \
|
| 40 |
&& curl -L "https://civitai.com/api/download/models/4201?type=Model&format=SafeTensor&size=full&fp16=false" -o ./models/checkpoints/realisticVisionV51_v51VAE.safetensors
|
| 41 |
|
| 42 |
+
# 5B. AJOUT CRITIQUE : VAEs et CLIP pour éviter les erreurs de génération
|
| 43 |
+
RUN mkdir -p models/vae models/clip \
|
| 44 |
+
&& curl -L "https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors" -o ./models/vae/vae-ft-mse-840000-ema-pruned.safetensors \
|
| 45 |
+
&& curl -L "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/vae.pt" -o ./models/vae/vae.pt \
|
| 46 |
+
&& curl -L "https://huggingface.co/comfyanonymous/clip_g/resolve/main/clip_g.safetensors" -o ./models/clip/clip_g.safetensors
|
| 47 |
+
|
| 48 |
# 6. Configuration Hugging Face Space (Port 7860 Obligatoire)
|
| 49 |
ENV PORT 7860
|
| 50 |
EXPOSE 7860
|