FROM python:3.11 # Install system packages RUN apt-get update && apt-get install -y \ git \ curl \ wget # Set working directory WORKDIR /app # Clone ComfyUI RUN git clone https://github.com/comfyanonymous/ComfyUI.git # Enter ComfyUI directory WORKDIR /app/ComfyUI # Upgrade pip RUN pip install --upgrade pip # Remove possible CUDA packages RUN pip uninstall -y torch torchvision torchaudio xformers || true # Install CPU-only PyTorch stack RUN pip install \ torch \ torchvision \ torchaudio \ --index-url https://download.pytorch.org/whl/cpu # Install ComfyUI requirements RUN pip install -r requirements.txt # Install ComfyUI Manager requirements RUN pip install -r manager_requirements.txt # ========================= # ComfyUI Manager Security Fix # ========================= ENV COMFYUI_MANAGER_SECURITY_LEVEL=weak ENV COMFYUI_MANAGER_DISABLE_SECURITY_POLICY=true # Create manager config directory RUN mkdir -p /app/ComfyUI/user/__manager # Create manager config RUN printf "[default]\nsecurity_level = weak\n" > /app/ComfyUI/user/__manager/config.ini # Optional useful environment settings ENV PYTHONUNBUFFERED=1 ENV HF_HUB_DISABLE_TELEMETRY=1 # Expose ComfyUI port EXPOSE 7860 # Start ComfyUI in CPU mode CMD ["python", "main.py", \ "--cpu", \ "--enable-manager", \ "--enable-manager-legacy-ui", \ "--listen", "0.0.0.0", \ "--port", "7860"]