kadirnar commited on
Commit
2dab131
1 Parent(s): d1d2ccc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -112
Dockerfile CHANGED
@@ -1,22 +1,19 @@
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
@@ -37,109 +34,25 @@ RUN pyenv install $PYTHON_VERSION && \
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
- # PyTorch installation with CUDA 12.1 support
43
-
44
- # Set the working directory to /data if USE_PERSISTENT_DATA is set, otherwise set to $HOME/app
45
- WORKDIR $HOME/app
46
-
47
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
48
-
49
- RUN git clone https://github.com/comfyanonymous/ComfyUI . && git checkout c6951548cfec64c28082e6560c69c59e32729c9c && \
50
- pip install xformers!=0.0.18 --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu121
51
-
52
- # Checkpoints
53
-
54
- RUN echo "Downloading checkpoints..."
55
- RUN wget -c https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors -P ./models/checkpoints/
56
- RUN wget -c https://huggingface.co/stabilityai/sdxl-turbo/resolve/main/sd_xl_turbo_1.0.safetensors -P ./models/checkpoints/
57
- RUN wget -c https://huggingface.co/SG161222/RealVisXL_V4.0_Lightning/resolve/main/RealVisXL_V4.0_Lightning.safetensors -P ./models/checkpoints/
58
- RUN wget -c https://huggingface.co/SG161222/RealVisXL_V3.0_Turbo/resolve/main/RealVisXL_V3.0_Turbo.safetensors -P ./models/checkpoints/
59
- RUN wget -c https://huggingface.co/RunDiffusion/Juggernaut-XL-Lightning/resolve/main/Juggernaut_RunDiffusionPhoto2_Lightning_4Steps.safetensors -P ./models/checkpoints/
60
- RUN wget -c https://huggingface.co/Lykon/dreamshaper-xl-lightning/resolve/main/DreamShaperXL_Lightning.safetensors -P ./models/checkpoints/
61
- RUN wget -c https://huggingface.co/Lykon/dreamshaper-xl-v2-turbo/resolve/main/DreamShaperXL_Turbo_v2_1.safetensors -P ./models/checkpoints/
62
- RUN wget -c https://huggingface.co/Lykon/DreamShaper/resolve/main/DreamShaper_8_INPAINTING.inpainting.safetensors -P ./models/checkpoints/
63
- RUN wget -c https://huggingface.co/Lykon/DreamShaper/resolve/main/DreamShaper_8_pruned.safetensors -P ./models/checkpoints/
64
-
65
- RUN echo "Downloading Controlnet..."
66
-
67
- RUN wget -c https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors -P ./models/vae/
68
- RUN wget -c https://huggingface.co/stabilityai/control-lora/resolve/main/control-LoRAs-rank256/control-lora-canny-rank256.safetensors -P ./models/controlnet/
69
- RUN wget -c https://huggingface.co/stabilityai/control-lora/resolve/main/control-LoRAs-rank256/control-lora-depth-rank256.safetensors -P ./models/controlnet/
70
- RUN wget -c https://huggingface.co/stabilityai/control-lora/resolve/main/control-LoRAs-rank256/control-lora-recolor-rank256.safetensors -P ./models/controlnet/
71
- RUN wget -c https://huggingface.co/stabilityai/control-lora/resolve/main/control-LoRAs-rank256/control-lora-sketch-rank256.safetensors -P ./models/controlnet/
72
- RUN wget -c https://huggingface.co/ArtGAN/Controlnet/resolve/main/controlnet-sdxl-canny-mid.safetensors -P ./models/controlnet/
73
- RUN wget -c https://huggingface.co/ArtGAN/Controlnet/resolve/main/controlnet-sdxl-depth-mid.safetensors -P ./models/controlnet/
74
-
75
- RUN echo "Downloading LLavacheckpoints..."
76
-
77
- RUN wget -c https://huggingface.co/cjpais/llava-1.6-mistral-7b-gguf/resolve/main/llava-v1.6-mistral-7b.Q5_K_M.gguf -P ./models/LLavacheckpoints/
78
- RUN wget -c https://huggingface.co/cjpais/llava-1.6-mistral-7b-gguf/resolve/main/llava-v1.6-mistral-7b.Q5_K_S.gguf -P ./models/LLavacheckpoints/
79
- RUN wget -c https://huggingface.co/cjpais/llava-1.6-mistral-7b-gguf/resolve/main/llava-v1.6-mistral-7b.Q4_K_M.gguf -P ./models/LLavacheckpoints/
80
- RUN wget -c https://huggingface.co/cjpais/llava-1.6-mistral-7b-gguf/resolve/main/mmproj-model-f16.gguf -P ./models/LLavacheckpoints/
81
-
82
- RUN echo "Downloading IPAdapter Plus..."
83
- RUN cd custom_nodes && git clone https://github.com/cubiq/ComfyUI_IPAdapter_plus
84
- RUN wget -c https://huggingface.co/h94/IP-Adapter/resolve/main/sdxl_models/ip-adapter-plus-face_sdxl_vit-h.safetensors -P ./ComfyUI_IPAdapter_plus/models/
85
- RUN wget -c https://huggingface.co/h94/IP-Adapter/resolve/main/sdxl_models/ip-adapter-plus_sdxl_vit-h.safetensors -P ./ComfyUI_IPAdapter_plus/models/
86
- RUN wget -c https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter-plus-face_sd15.safetensors -P ./ComfyUI_IPAdapter_plus/models/
87
- RUN wget -c https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter-plus_sd15.safetensors -P ./ComfyUI_IPAdapter_plus/models/
88
-
89
- RUN echo "Downloading ClipVision..."
90
-
91
- RUN wget -c https://huggingface.co/ArtGAN/Controlnet/resolve/main/CLIP-ViT-H-14-laion2B-s32B-b79K.safetensors
92
- RUN wget -c https://huggingface.co/ArtGAN/Controlnet/resolve/main/sd15_model.safetensors
93
- RUN wget -c https://huggingface.co/ArtGAN/Controlnet/resolve/main/sdxl_model.safetensors
94
-
95
- RUN echo "Downloading Upscaler..."
96
-
97
- RUN wget -c https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P ./models/upscale_models/
98
- RUN wget -c https://huggingface.co/sberbank-ai/Real-ESRGAN/resolve/main/RealESRGAN_x2.pth -P ./models/upscale_models/
99
- RUN wget -c https://huggingface.co/sberbank-ai/Real-ESRGAN/resolve/main/RealESRGAN_x4.pth -P ./models/upscale_models/
100
-
101
- RUN wget -c https://huggingface.co/ArtGAN/Controlnet/resolve/main/lcm-lora-sdv1-5.safetensors -P ./models/loras/
102
- RUN wget -c https://huggingface.co/ArtGAN/Controlnet/resolve/main/lcm-lora-sdxl.safetensors -P ./models/loras/
103
-
104
- RUN echo "Done"
105
-
106
- # instal custom nodes
107
- RUN echo "Installing custom nodes..."
108
- RUN pip install -U onnxruntime-gpu
109
-
110
- RUN cd custom_nodes && git clone https://github.com/ltdrdata/ComfyUI-Manager.git
111
- RUN cd custom_nodes && git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack && cd ComfyUI-Impact-Pack && python install.py
112
- RUN cd custom_nodes && git clone https://github.com/ltdrdata/ComfyUI-Inspire-Pack && cd ComfyUI-Inspire-Pack && pip install -r requirements.txt
113
- RUN cd custom_nodes && git clone https://github.com/Fannovel16/ComfyUI-Frame-Interpolation && cd ComfyUI-Frame-Interpolation && python install.py
114
- RUN cd custom_nodes && git clone https://github.com/Fannovel16/ComfyUI-Video-Matting && cd ComfyUI-Video-Matting && pip install -r requirements.txt
115
- RUN cd custom_nodes && git clone https://github.com/BlenderNeko/ComfyUI_Cutoff
116
- RUN cd custom_nodes && git clone https://github.com/WASasquatch/PPF_Noise_ComfyUI && cd PPF_Noise_ComfyUI && pip install -r requirements.txt
117
- RUN cd custom_nodes && git clone https://github.com/WASasquatch/PowerNoiseSuite && cd PowerNoiseSuite && pip install -r requirements.txt
118
- RUN cd custom_nodes && git clone https://github.com/Jordach/comfy-plasma
119
- RUN cd custom_nodes && git clone https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes
120
- RUN cd custom_nodes && git clone https://github.com/space-nuko/ComfyUI-OpenPose-Editor
121
- RUN cd custom_nodes && git clone https://github.com/twri/sdxl_prompt_styler
122
- RUN cd custom_nodes && git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved
123
- RUN cd custom_nodes && git clone https://github.com/AIrjen/OneButtonPrompt
124
-
125
- RUN pip install -U torch torchvision torchaudio
126
-
127
- RUN cd custom_nodes && git clone https://github.com/gokayfem/ComfyUI_VLM_nodes && cd ComfyUI_VLM_nodes && pip install -r requirements.txt
128
- RUN cd custom_nodes && git clone https://github.com/Fannovel16/comfyui_controlnet_aux && cd comfyui_controlnet_aux && pip install -r requirements.txt
129
- RUN cd custom_nodes && git clone https://github.com/Stability-AI/stability-ComfyUI-nodes && cd stability-ComfyUI-nodes && pip install -r requirements.txt
130
- RUN cd custom_nodes && git clone https://github.com/jags111/efficiency-nodes-comfyui && cd efficiency-nodes-comfyui && pip install -r requirements.txt
131
- RUN cd custom_nodes && git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite && cd ComfyUI-VideoHelperSuite && pip install -r requirements.txt
132
- RUN cd custom_nodes && git clone https://github.com/pythongosssss/ComfyUI-Custom-Scripts
133
- RUN cd custom_nodes && git clone https://github.com/WASasquatch/FreeU_Advanced
134
- RUN cd custom_nodes && git clone https://github.com/city96/SD-Advanced-Noise
135
 
136
- RUN cd custom_nodes && git clone https://github.com/sipherxyz/comfyui-art-venture && cd comfyui-art-venture && pip install -r requirements.txt
137
- RUN cd custom_nodes && git clone https://github.com/evanspearman/ComfyMath && cd ComfyMath && pip install -r requirements.txt
138
- RUN cd custom_nodes && git clone https://github.com/Gourieff/comfyui-reactor-node && cd comfyui-reactor-node && pip install -r requirements.txt
139
- RUN cd custom_nodes && git clone https://github.com/rgthree/rgthree-comfy && cd rgthree-comfy && pip install -r requirements.txt
140
- RUN cd custom_nodes && git clone https://github.com/giriss/comfy-image-saver && cd comfy-image-saver && pip install -r requirements.txt
141
 
 
 
 
 
142
 
143
- RUN echo "Done"
 
144
 
145
- CMD ["python", "main.py", "--listen", "0.0.0.0", "--port", "7860", "--output-directory", "${USE_PERSISTENT_DATA:+/data/}"]
 
 
1
+ # Choose an appropriate base image with CUDA support
2
+ FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04
3
 
4
+ # Set the working directory in the container
5
+ WORKDIR /app
 
 
6
 
7
+ # Install Python, pip, and other necessary packages
8
  RUN apt-get update && apt-get install -y \
9
+ git libgl1 libglib2.0-0 \
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
+ apt-get install nvidia-container-runtime
 
 
 
17
 
18
  # User
19
  RUN useradd -m -u 1000 user
 
34
  pip install --no-cache-dir \
35
  datasets \
36
  huggingface-hub "protobuf<4" "click<8.1"
37
+
38
+ # Install PyTorch with CUDA support matching the CUDA version of the base image
39
+ RUN pip3 install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu121
40
 
41
+ # Install flash attention and apex (if needed)
42
+ RUN pip3 install packaging ninja
43
+ RUN pip3 install flash-attn --no-build-isolation
44
+ RUN pip3 install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" git+https://github.com/NVIDIA/apex.git
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
+ # Install xformers with the specific CUDA version
47
+ RUN pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121
 
 
 
48
 
49
+ # Clone and install your project
50
+ RUN git clone https://github.com/hpcaitech/Open-Sora /app/Open-Sora
51
+ WORKDIR /app/Open-Sora
52
+ RUN pip3 install -v .
53
 
54
+ # Expose the port used by Gradio
55
+ EXPOSE 7860
56
 
57
+ # Set the command to run your application
58
+ CMD ["python3", "/app/app.py"]