File size: 944 Bytes
e963865
 
 
 
74d82b0
e963865
 
 
4c68b87
 
 
e963865
 
 
 
 
4c68b87
 
 
e963865
74d82b0
 
 
 
 
 
 
4c68b87
 
74d82b0
 
e963865
4c68b87
 
 
e963865
 
 
 
4c68b87
 
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
FROM python:3.10-slim

WORKDIR /app

# 安装系统依赖
RUN apt-get update && apt-get install -y \
    git \
    wget \
    curl \
    libgl1 \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

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

# 安装 Python 依赖(CPU 版本)
RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
RUN pip install --no-cache-dir -r requirements.txt

# 创建必要的目录结构
RUN mkdir -p \
    models/checkpoints \
    models/vae \
    models/loras \
    models/controlnet \
    models/upscale_models \
    models/clip_vision \
    models/embeddings \
    input \
    output

# 设置环境变量强制使用 CPU
ENV CUDA_VISIBLE_DEVICES=""
ENV PYTHONUNBUFFERED=1

# 暴露端口
EXPOSE 7860

# 启动 ComfyUI(强制 CPU 模式)
CMD ["python", "main.py", "--listen", "0.0.0.0", "--port", "7860", "--cpu"]