|
|
|
|
|
|
|
|
FROM ubuntu:24.04 |
|
|
ENV DEBIAN_FRONTEND=noninteractive |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
|
python3 python3-venv python3-pip git wget \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
RUN useradd -m -s /bin/bash comfy |
|
|
|
|
|
|
|
|
WORKDIR /workspace |
|
|
RUN git clone https://github.com/comfyanonymous/ComfyUI.git |
|
|
WORKDIR /workspace/ComfyUI |
|
|
|
|
|
|
|
|
RUN python3 -m venv .venv \ |
|
|
&& . .venv/bin/activate \ |
|
|
&& pip install --upgrade pip \ |
|
|
&& pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu \ |
|
|
&& pip install huggingface_hub xformers!=0.0.18 \ |
|
|
&& pip install -r requirements.txt |
|
|
|
|
|
|
|
|
RUN git clone https://github.com/Comfy-Org/ComfyUI-Manager.git /workspace/ComfyUI/custom_nodes/ComfyUI-Manager |
|
|
|
|
|
|
|
|
RUN mkdir -p /workspace/ComfyUI/user/default /workspace/ComfyUI/temp /workspace/ComfyUI/db |
|
|
|
|
|
|
|
|
COPY download_flux.py /workspace/ComfyUI/download_flux.py |
|
|
|
|
|
|
|
|
RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \ |
|
|
. .venv/bin/activate && \ |
|
|
python download_flux.py |
|
|
|
|
|
|
|
|
RUN chown -R comfy:comfy /workspace && chmod -R 777 /workspace |
|
|
|
|
|
|
|
|
USER comfy |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["/bin/bash", "-c", "source .venv/bin/activate && python3 main.py --listen 0.0.0.0 --port 7860 --cpu --use-split-cross-attention"] |
|
|
|