File size: 1,141 Bytes
f30aa18
 
 
 
 
c811320
f30aa18
 
 
1f3ac2e
f30aa18
 
 
 
 
 
7d6ff40
 
 
 
 
 
f30aa18
 
 
 
 
 
 
 
 
 
 
c811320
 
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
FROM python:3.10-slim

ENV DEBIAN_FRONTEND=noninteractive \
    PYTHONUNBUFFERED=1

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    wget \
    libgl1 \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Clone ComfyUI
RUN git clone https://github.com/comfyanonymous/ComfyUI.git .

# Install CPU-only PyTorch stack (torchaudio must come from CPU index or it links libcudart)
RUN pip install --no-cache-dir \
    torch torchvision torchaudio \
    --index-url https://download.pytorch.org/whl/cpu && \
    pip install --no-cache-dir -r requirements.txt

# Download a small fast model (SD 1.5 pruned EMA-only ~2GB)
RUN mkdir -p models/checkpoints models/vae models/controlnet && \
    wget -q --show-progress \
        https://huggingface.co/genai-archive/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.fp16.safetensors \
        -O models/checkpoints/v1-5-pruned-emaonly.fp16.safetensors

# Expose the port HF Spaces expects
EXPOSE 7860

# Run ComfyUI in CPU mode bound to all interfaces on port 7860
CMD ["python", "main.py", "--listen", "0.0.0.0", "--port", "7860", "--cpu"]