Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +81 -0
Dockerfile
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
|
2 |
+
|
3 |
+
ENV DEBIAN_FRONTEND=noninteractive \
|
4 |
+
TZ=America/Los_Angeles
|
5 |
+
|
6 |
+
ARG USE_PERSISTENT_DATA
|
7 |
+
|
8 |
+
RUN apt-get update && apt-get install -y \
|
9 |
+
git \
|
10 |
+
make build-essential libssl-dev zlib1g-dev \
|
11 |
+
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
|
12 |
+
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev git git-lfs \
|
13 |
+
ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx \
|
14 |
+
&& rm -rf /var/lib/apt/lists/* \
|
15 |
+
&& git lfs install
|
16 |
+
|
17 |
+
WORKDIR /code
|
18 |
+
|
19 |
+
COPY ./requirements.txt /code/requirements.txt
|
20 |
+
|
21 |
+
# User
|
22 |
+
RUN useradd -m -u 1000 user
|
23 |
+
USER user
|
24 |
+
ENV HOME=/home/user \
|
25 |
+
PATH=/home/user/.local/bin:$PATH
|
26 |
+
|
27 |
+
# Pyenv
|
28 |
+
RUN curl https://pyenv.run | bash
|
29 |
+
ENV PATH=$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH
|
30 |
+
|
31 |
+
ARG PYTHON_VERSION=3.10.12
|
32 |
+
# Python
|
33 |
+
RUN pyenv install $PYTHON_VERSION && \
|
34 |
+
pyenv global $PYTHON_VERSION && \
|
35 |
+
pyenv rehash && \
|
36 |
+
pip install --no-cache-dir --upgrade pip setuptools wheel && \
|
37 |
+
pip install --no-cache-dir \
|
38 |
+
datasets \
|
39 |
+
huggingface-hub "protobuf<4" "click<8.1"
|
40 |
+
|
41 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
42 |
+
|
43 |
+
# Set the working directory to /data if USE_PERSISTENT_DATA is set, otherwise set to $HOME/app
|
44 |
+
WORKDIR $HOME/app
|
45 |
+
|
46 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
47 |
+
|
48 |
+
RUN git clone https://github.com/comfyanonymous/ComfyUI . && git checkout c6951548cfec64c28082e6560c69c59e32729c9c && \
|
49 |
+
pip install xformers!=0.0.18 --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu121
|
50 |
+
|
51 |
+
# Checkpoints
|
52 |
+
|
53 |
+
RUN echo "Downloading checkpoints..."
|
54 |
+
RUN wget -c https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors -P ./models/checkpoints/
|
55 |
+
RUN wget -c https://huggingface.co/stabilityai/sdxl-turbo/resolve/main/sd_xl_turbo_1.0.safetensors -P ./models/checkpoints/
|
56 |
+
|
57 |
+
RUN wget -c https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors -P ./models/vae/
|
58 |
+
RUN wget -c https://huggingface.co/stabilityai/control-lora/resolve/main/control-LoRAs-rank256/control-lora-canny-rank256.safetensors -P ./models/controlnet/
|
59 |
+
RUN wget -c https://huggingface.co/stabilityai/control-lora/resolve/main/control-LoRAs-rank256/control-lora-depth-rank256.safetensors -P ./models/controlnet/
|
60 |
+
RUN wget -c https://huggingface.co/stabilityai/control-lora/resolve/main/control-LoRAs-rank256/control-lora-recolor-rank256.safetensors -P ./models/controlnet/
|
61 |
+
RUN wget -c https://huggingface.co/stabilityai/control-lora/resolve/main/control-LoRAs-rank256/control-lora-sketch-rank256.safetensors -P ./models/controlnet/
|
62 |
+
|
63 |
+
RUN wget -c https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P ./models/upscale_models/
|
64 |
+
RUN wget -c https://huggingface.co/sberbank-ai/Real-ESRGAN/resolve/main/RealESRGAN_x2.pth -P ./models/upscale_models/
|
65 |
+
RUN wget -c https://huggingface.co/sberbank-ai/Real-ESRGAN/resolve/main/RealESRGAN_x4.pth -P ./models/upscale_models/
|
66 |
+
|
67 |
+
RUN echo "Done"
|
68 |
+
|
69 |
+
# instal custom nodes
|
70 |
+
RUN echo "Installing custom nodes..."
|
71 |
+
# Controlnet Preprocessor nodes by Fannovel16
|
72 |
+
RUN cd custom_nodes && git clone https://github.com/Fannovel16/comfy_controlnet_preprocessors && cd comfy_controlnet_preprocessors && python install.py --no_download_ckpts
|
73 |
+
RUN cd custom_nodes && git clone https://github.com/Fannovel16/comfyui_controlnet_aux && cd comfyui_controlnet_aux && pip install -r requirements.txt
|
74 |
+
RUN cd custom_nodes && git clone https://github.com/Stability-AI/stability-ComfyUI-nodes && cd stability-ComfyUI-nodes && pip install -r requirements.txt
|
75 |
+
RUN cd custom_nodes && git clone https://github.com/EllangoK/ComfyUI-post-processing-nodes
|
76 |
+
|
77 |
+
RUN cd custom_nodes && git clone https://github.com/ltdrdata/ComfyUI-Manager.git
|
78 |
+
|
79 |
+
RUN echo "Done"
|
80 |
+
|
81 |
+
CMD ["python", "main.py", "--listen", "0.0.0.0", "--port", "7860", "--output-directory", "${USE_PERSISTENT_DATA:+/data/}"]
|