File size: 15,422 Bytes
fc053e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5df1fd5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
01b2411
 
6abb448
 
a95e569
 
1e82fe1
c9d696d
a98326b
 
c306118
 
fc053e1
 
 
 
 
 
 
 
 
 
 
 
5df1fd5
 
 
 
0c7005e
ac66acf
5df1fd5
 
 
 
ac66acf
5df1fd5
 
 
ac66acf
 
5df1fd5
 
 
 
ac66acf
 
5df1fd5
ac66acf
 
5df1fd5
 
ac66acf
fc053e1
5df1fd5
fc053e1
 
5df1fd5
fc053e1
a828fc6
 
1b98ee5
fc053e1
c306118
 
5df1fd5
c306118
7b58311
0c7005e
7b58311
c306118
0c7005e
7b58311
 
 
 
 
0065ce0
7b58311
 
0065ce0
7b58311
 
0c7005e
7b58311
 
 
fc053e1
 
7b58311
 
 
 
 
 
c306118
 
fc053e1
 
0065ce0
ac66acf
0065ce0
7b58311
 
 
dcb4c33
4c4a48c
c306118
 
0065ce0
5df1fd5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
01b2411
 
a95e569
 
 
0065ce0
5df1fd5
fc053e1
0c7005e
 
5df1fd5
0c7005e
 
0065ce0
7b58311
 
 
 
 
 
ac66acf
 
0065ce0
 
5df1fd5
fc053e1
451ca25
 
1e82fe1
04e78aa
fc053e1
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04

ENV DEBIAN_FRONTEND=noninteractive \
    TZ=America/Los_Angeles

ARG USE_PERSISTENT_DATA

RUN apt-get update && apt-get install -y \
    git \
    make build-essential libssl-dev zlib1g-dev \
    libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
    libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev git-lfs  \
    ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx \
    && rm -rf /var/lib/apt/lists/* \
    && git lfs install

WORKDIR /code

COPY ./requirements.txt /code/requirements.txt

# User
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Pyenv
RUN curl https://pyenv.run | bash
ENV PATH=$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH

ARG PYTHON_VERSION=3.9.17
# Python
RUN pyenv install $PYTHON_VERSION && \
    pyenv global $PYTHON_VERSION && \
    pyenv rehash && \
    pip install --no-cache-dir --upgrade pip setuptools wheel && \
    pip install --no-cache-dir \
    datasets \
    huggingface-hub "protobuf<4" "click<8.1" && \
	pip install scikit-image && \
	pip install numba && \
	pip install dynamicprompts && \
	pip install onnxruntime && \
	pip install color-matcher && \
	pip install piexif && \
	pip install dynamicprompts && \
	pip install lpips && \
	pip install llama-cpp-python && \
	pip install einops && \
	pip install torchsde && \
	pip install ultralytics && \
	pip install simpleeval && \
	pip install gray2color && \
	pip install segment-anything && \
	pip install typing-aliases && \
	pip install insightface && \
	pip install deepdiff && \
	pip install addict && \
	pip install pynvml && \
	pip install yapf && \
	pip install numexpr && \ 
	pip install timm
	#pip install huggingface_hub["cli"] && \
	#huggingface-cli delete-cache
	
	
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

# Set the working directory to /data if USE_PERSISTENT_DATA is set, otherwise set to $HOME/app
WORKDIR $HOME/app

# Clone the ComfyUI repo (fork with restart button)
RUN git clone https://github.com/comfyanonymous/ComfyUI.git . && \
    pip install --no-cache-dir -r requirements.txt 

# Checkpoints
RUN echo "Downloading checkpoints..." && \ 
    # Kybalico Models
    #wget -c https://huggingface.co/Kybalico/CandyApple/resolve/main/candyApple_v12.safetensors -P ./models/checkpoints/ && \
    #wget -c https://huggingface.co/Kybalico/CalicoMix/resolve/main/calicoMix_v75.safetensors -P ./models/checkpoints/ && \
    #wget -c https://huggingface.co/Kybalico/CalicoMixDC/resolve/main/calicomix_dcV30.safetensors -P ./models/checkpoints/ && \
    #wget -c https://huggingface.co/Kybalico/AnmitsuMimimi/resolve/main/anmitsuMimimi_v10.safetensors -P ./models/checkpoints/ && \
	#wget -c https://civitai.com/api/download/models/128713 -P ./models/checkpoints/ && \
	# SD1.5
	#wget -c https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt -P ./models/checkpoints/ && \
	#wget -c https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors -P ./models/checkpoints/ && \
	#wget -c https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0/resolve/main/sd_xl_refiner_1.0.safetensors -P ./models/checkpoints/ && \
	#wget -c https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt/resolve/main/svd_xt.safetensors -P ./models/checkpoints/ && \
	# SD2
	#wget -c https://huggingface.co/stabilityai/stable-diffusion-2-1-base/resolve/main/v2-1_512-ema-pruned.safetensors -P ./models/checkpoints/ && \
	#wget -c https://huggingface.co/stabilityai/stable-diffusion-2-1/resolve/main/v2-1_768-ema-pruned.safetensors -P ./models/checkpoints/ && \


	# Some SD1.5 anime style
	#wget -c https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/Models/AbyssOrangeMix2/AbyssOrangeMix2_hard.safetensors -P ./models/checkpoints/ && \
	#wget -c https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/Models/AbyssOrangeMix3/AOM3A1_orangemixs.safetensors -P ./models/checkpoints/ && \
	#wget -c https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/Models/AbyssOrangeMix3/AOM3A3_orangemixs.safetensors -P ./models/checkpoints/ && \
	#wget -c https://huggingface.co/Linaqruf/anything-v3.0/resolve/main/anything-v3-fp16-pruned.safetensors -P ./models/checkpoints/ && \

	# Waifu Diffusion 1.5 (anime style SD2.x 768-v)
	#wget -c https://huggingface.co/waifu-diffusion/wd-1-5-beta2/resolve/main/checkpoints/wd-1-5-beta2-fp16.safetensors -P ./models/checkpoints/ && \

	# unCLIP models
	#wget -c https://huggingface.co/comfyanonymous/illuminatiDiffusionV1_v11_unCLIP/resolve/main/illuminatiDiffusionV1_v11-unclip-h-fp16.safetensors -P ./models/checkpoints/ && \
	#wget -c https://huggingface.co/comfyanonymous/wd-1.5-beta2_unCLIP/resolve/main/wd-1-5-beta2-aesthetic-unclip-h-fp16.safetensors -P ./models/checkpoints/ && \

    # TechnoByte Models
    #wget -c https://huggingface.co/TechnoByte/MilkyWonderland/resolve/main/milkyWonderland_v20.safetensors -P ./models/checkpoints/ && \

    # VAE
    #wget -c https://huggingface.co/RedRayz/MyVAE/resolve/main/CleanVAE.safetensors -P ./models/vae/ && \
    wget -c https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors -P ./models/vae/ && \
	#wget -c https://huggingface.co/tuwonga/marblesh/resolve/main/marblesh.safetensors -P ./models/vae/ && \
	#wget -c https://huggingface.co/SimianLuo/LCM_Dreamshaper_v7/blob/main/LCM_Dreamshaper_v7_4k.safetensors -P ./models/vae/ && \
	
    # ControlNet
    # wget -c https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11e_sd15_ip2p_fp16.safetensors -P ./models/controlnet/ && \
    # wget -c https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11e_sd15_shuffle_fp16.safetensors -P ./models/controlnet/ && \
    #wget -c https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_canny_fp16.safetensors -P ./models/controlnet/ && \
    # wget -c https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11f1p_sd15_depth_fp16.safetensors -P ./models/controlnet/ && \
    # wget -c https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_inpaint_fp16.safetensors -P ./models/controlnet/ && \
    wget -c https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_lineart_fp16.safetensors -P ./models/controlnet/ && \
    # wget -c https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_mlsd_fp16.safetensors -P ./models/controlnet/ && \
    # wget -c https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_normalbae_fp16.safetensors -P ./models/controlnet/ && \
    wget -c https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_openpose_fp16.safetensors -P ./models/controlnet/ && \
    # wget -c https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_scribble_fp16.safetensors -P ./models/controlnet/ && \
    # wget -c https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_seg_fp16.safetensors -P ./models/controlnet/ && \
    # wget -c https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_softedge_fp16.safetensors -P ./models/controlnet/ && \
    # wget -c https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15s2_lineart_anime_fp16.safetensors -P ./models/controlnet/ && \
    # wget -c https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11u_sd15_tile_fp16.safetensors -P ./models/controlnet/ && \
	
    # # GLIGEN
    # wget -c https://huggingface.co/comfyanonymous/GLIGEN_pruned_safetensors/resolve/main/gligen_sd14_textbox_pruned_fp16.safetensors -P ./models/gligen/ && \ 
    
    # # ESRGAN upscale model
    # wget -c https://huggingface.co/konohashinobi4/4xAnimesharp/resolve/main/4x-AnimeSharp.pth -P ./models/upscale_models/ && \
	wget -c https://huggingface.co/lokCX/4x-Ultrasharp/blob/main/4x-UltraSharp.pth -P ./models/upscale_models/ && \
	# wget -c https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P ./models/upscale_models/ && \
	# wget -c https://huggingface.co/sberbank-ai/Real-ESRGAN/resolve/main/RealESRGAN_x2.pth -P ./models/upscale_models/ && \
	# wget -c https://huggingface.co/sberbank-ai/Real-ESRGAN/resolve/main/RealESRGAN_x4.pth -P ./models/upscale_models/ && \
	
	# motion_lora
	# wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_PanLeft.ckpt -P ./models/motion_lora/ && \
	# wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_PanRight.ckpt -P ./models/motion_lora/ && \
	# wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_RollingAnticlockwise.ckpt -P ./models/motion_lora/ && \
	# wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_RollingClockwise.ckpt -P ./models/motion_lora/ && \
	# wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_TiltDown.ckpt -P ./models/motion_lora/ && \
	# wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_TiltUp.ckpt -P ./models/motion_lora/ && \
	# wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_ZoomIn.ckpt -P ./models/motion_lora/ && \
	# wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_ZoomOut.ckpt -P ./models/motion_lora/ && \


	# loras
	#wget -c https://huggingface.co/stabilityai/control-lora/blob/main/control-LoRAs-rank256/control-lora-canny-rank256.safetensors  -P ./models/loras/ && \
	
    # # Aesthetic scorer models
    # mkdir ./models/aesthetic && \
    # wget -c https://github.com/grexzen/SD-Chad/raw/main/chadscorer.pth -P ./models/aesthetic/ && \
    # wget -c https://github.com/christophschuhmann/improved-aesthetic-predictor/raw/main/ava+logos-l14-linearMSE.pth -P ./models/aesthetic/

    echo "Installing custom nodes..."
	
    # ComfyUI Manager
    RUN cd custom_nodes && \
		git clone https://github.com/ltdrdata/ComfyUI-Manager.git && \	
		git clone https://github.com/civitai/civitai_comfy_nodes.git && \
		#Historia de vida, video2video, Dj, texto2video
		git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git   && \
		git clone https://github.com/Fannovel16/comfyui_controlnet_aux.git && \
		git clone https://github.com/FizzleDorf/ComfyUI_FizzNodes.git && \
		git clone https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet.git && \
		git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved.git && \
		git clone https://github.com/adieyal/comfyui-dynamicprompts.git && \
		git clone https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git  && \
		git clone https://github.com/rgthree/rgthree-comfy.git && \
		git clone https://github.com/TinyTerra/ComfyUI_tinyterraNodes.git && \
		git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack.git && \
		git clone https://github.com/mav-rik/facerestore_cf.git && \
		git clone https://github.com/Stability-AI/stability-ComfyUI-nodes.git && \
		git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes.git && \
		git clone https://github.com/giriss/comfy-image-saver.git && \
		git clone https://github.com/Nuked88/ComfyUI-N-Nodes.git && \
		git clone https://github.com/jags111/efficiency-nodes-comfyui.git && \
		git clone https://github.com/bmad4ever/comfyui_bmad_nodes.git

    RUN cd custom_nodes && \
		git clone https://github.com/cubiq/ComfyUI_IPAdapter_plus.git && \
		git clone https://github.com/chrisgoringe/cg-use-everywhere.git && \ 
		git clone https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git && \
		git clone https://github.com/WASasquatch/was-node-suite-comfyui.git && \
		git clone https://github.com/theUpsider/ComfyUI-Logic.git && \
		git clone https://github.com/evanspearman/ComfyMath.git && \
		git clone https://github.com/WASasquatch/PowerNoiseSuite && \
		git clone https://github.com/cubiq/ComfyUI_essentials.git && \
		git clone https://github.com/mcmonkeyprojects/sd-dynamic-thresholding.git && \
		git clone https://github.com/ltdrdata/ComfyUI-Inspire-Pack.git && \
		git clone https://github.com/Fannovel16/ComfyUI-Frame-Interpolation.git && \
		git clone https://github.com/BlenderNeko/ComfyUI_ADV_CLIP_emb.git && \
		git clone https://github.com/Gourieff/comfyui-reactor-node.git && \
		git clone https://github.com/Nourepide/ComfyUI-Allor.git && \
		git clone https://github.com/storyicon/comfyui_segment_anything.git && \
	    git clone https://github.com/crystian/ComfyUI-Crystools && \
		git clone https://github.com/EllangoK/ComfyUI-post-processing-nodes && \
		git clone https://github.com/melMass/comfy_mtb.git
		
    # Install custom nodes
    RUN echo "Installing custom nodes..."
    
	#RUN cd custom_nodes && wget -c https://huggingface.co/guoyww/animatediff/resolve/main/mm_sd_v15_v2.ckpt -P ./ComfyUI-AnimateDiff-Evolved/models/
	#RUN cd custom_nodes && wget -c https://huggingface.co/guoyww/animatediff/resolve/main/mm_sd_v15.ckpt -P ./ComfyUI-AnimateDiff-Evolved/models/ && \

	# AnimateDiff
	RUN cd custom_nodes && wget -c https://huggingface.co/guoyww/animatediff/blob/main/v3_sd15_mm.ckpt -P ./custom_nodes/ComfyUI-AnimateDiff-Evolved/models/

	# RUN cd custom_nodes && wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_PanLeft.ckpt -P ./custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora/
	# RUN cd custom_nodes && wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_PanRight.ckpt -P ./custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora/
	# RUN cd custom_nodes && wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_RollingAnticlockwise.ckpt -P ./custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora/
	# RUN cd custom_nodes && wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_RollingClockwise.ckpt -P ./custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora/
	# RUN cd custom_nodes && wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_TiltDown.ckpt -P ./custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora/
	# RUN cd custom_nodes && wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_TiltUp.ckpt -P ./custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora/
	# RUN cd custom_nodes && wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_ZoomIn.ckpt -P ./custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora/
	# RUN cd custom_nodes && wget -c https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_ZoomOut.ckpt -P ./custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora/
  
    RUN echo "Done"
	RUN pip install torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu118

	RUN mkdir /home/user/app/models/insightface

#CMD ["python", "main.py", "--cpu", "--listen", "0.0.0.0", "--cpu", "--port", "7860", "--use-split-cross-attention", "--output-directory", "${USE_PERSISTENT_DATA:+/data/}"]
CMD ["python", "main.py", "--cpu", "--listen", "0.0.0.0", "--cpu", "--port", "7860", "--use-split-cross-attention", "--multi-user"]