msrcam commited on
Commit
8ef8443
Β·
verified Β·
1 Parent(s): 4a29aed

Upload installers/nudify/install_flux_ultimate_nudify_v0.24.sh with huggingface_hub

Browse files
installers/nudify/install_flux_ultimate_nudify_v0.24.sh ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # ═══════════════════════════════════════════════════════════════════════════════
3
+ # FLUX Ultimate Nudify - Installation Script v0.24
4
+ # ═══════════════════════════════════════════════════════════════════════════════
5
+ #
6
+ # Uses msrcam mirror repo for reliable downloads
7
+ #
8
+ # ═══════════════════════════════════════════════════════════════════════════════
9
+
10
+ set -e
11
+
12
+ # Colors
13
+ RED='\033[0;31m'
14
+ GREEN='\033[0;32m'
15
+ YELLOW='\033[1;33m'
16
+ MAGENTA='\033[0;35m'
17
+ CYAN='\033[0;36m'
18
+ NC='\033[0m'
19
+
20
+ # Configuration
21
+ COMFY_DIR="${COMFY_DIR:-/workspace/ComfyUI}"
22
+ CIVITAI_TOKEN="${CIVITAI_TOKEN:-eff2ba98a34d6fd7918164753e878bb9}"
23
+ HF_TOKEN="${HF_TOKEN:-}"
24
+
25
+ # Mirror repo
26
+ MIRROR="https://huggingface.co/msrcam/ComfyUI_Models/resolve/main"
27
+
28
+ # Banner
29
+ echo -e "${CYAN}═══════════════════════════════════════════════════════════════════════════════${NC}"
30
+ echo -e "${CYAN} FLUX ULTIMATE NUDIFY v0.24${NC}"
31
+ echo -e "${CYAN}═══════════════════════════════════════════════════════════════════════════════${NC}"
32
+ echo ""
33
+
34
+ # Install aria2c
35
+ apt-get update -qq && apt-get install -y -qq aria2 > /dev/null 2>&1 || true
36
+ echo -e "${GREEN}βœ“ aria2c ready${NC}"
37
+
38
+ # Download function
39
+ dl() {
40
+ local url="$1"
41
+ local dest="$2"
42
+ local desc="$3"
43
+
44
+ if [ -f "$dest" ]; then
45
+ echo -e "${GREEN}βœ“ Exists: ${desc}${NC}"
46
+ return 0
47
+ fi
48
+
49
+ mkdir -p "$(dirname "$dest")"
50
+ echo -e "${YELLOW}↓ ${desc}${NC}"
51
+
52
+ [[ "$url" == *"civitai.com"* ]] && url="${url}?token=${CIVITAI_TOKEN}"
53
+
54
+ if [[ "$url" == *"huggingface.co"* ]] && [ -n "$HF_TOKEN" ]; then
55
+ aria2c -x 16 -s 16 -k 1M -c --console-log-level=warn \
56
+ --header="Authorization: Bearer ${HF_TOKEN}" \
57
+ -d "$(dirname "$dest")" -o "$(basename "$dest")" "$url" 2>/dev/null && {
58
+ echo -e "${GREEN}βœ“ ${desc}${NC}"
59
+ return 0
60
+ }
61
+ else
62
+ aria2c -x 16 -s 16 -k 1M -c --console-log-level=warn \
63
+ -d "$(dirname "$dest")" -o "$(basename "$dest")" "$url" 2>/dev/null && {
64
+ echo -e "${GREEN}βœ“ ${desc}${NC}"
65
+ return 0
66
+ }
67
+ fi
68
+
69
+ echo -e "${RED}βœ— Failed: ${desc}${NC}"
70
+ return 1
71
+ }
72
+
73
+ # ═══════════════════════════════════════════════════════════════════════════════
74
+ # VERIFY & SETUP
75
+ # ═══════════════════════════════════════════════════════════════════════════════
76
+ echo -e "\n${YELLOW}[1/7] Setup...${NC}"
77
+ [ ! -d "$COMFY_DIR" ] && { echo -e "${RED}ComfyUI not found at $COMFY_DIR${NC}"; exit 1; }
78
+ echo -e "${GREEN}βœ“ ComfyUI found${NC}"
79
+
80
+ mkdir -p "$COMFY_DIR/models"/{checkpoints,unet,diffusion_models,vae,clip,text_encoders,loras}
81
+ mkdir -p "$COMFY_DIR/models"/{upscale_models,insightface/models/buffalo_l,facerestore_models}
82
+ mkdir -p "$COMFY_DIR/models"/{ultralytics/bbox,ultralytics/segm,sams,reactor}
83
+ mkdir -p "$COMFY_DIR/user/default/workflows"
84
+ echo -e "${GREEN}βœ“ Directories created${NC}"
85
+
86
+ # ═══════════════════════════════════════════════════════════════════════════════
87
+ # CUSTOM NODES
88
+ # ═══════════════════════════════════════════════════════════════════════════════
89
+ echo -e "\n${YELLOW}[2/7] Custom Nodes...${NC}"
90
+ cd "$COMFY_DIR/custom_nodes"
91
+
92
+ for repo in \
93
+ "https://github.com/ltdrdata/ComfyUI-Manager.git" \
94
+ "https://github.com/ltdrdata/ComfyUI-Impact-Pack.git" \
95
+ "https://github.com/ltdrdata/ComfyUI-Impact-Subpack.git" \
96
+ "https://github.com/Gourieff/ComfyUI-ReActor.git" \
97
+ "https://github.com/cubiq/ComfyUI_essentials.git" \
98
+ "https://github.com/rgthree/rgthree-comfy.git" \
99
+ "https://github.com/ssitu/ComfyUI_UltimateSDUpscale.git" \
100
+ "https://github.com/pythongosssss/ComfyUI-Custom-Scripts.git" \
101
+ "https://github.com/chrisgoringe/cg-use-everywhere.git"
102
+ do
103
+ name=$(basename "$repo" .git)
104
+ [ ! -d "$name" ] && { echo -e "${CYAN} β†’ ${name}${NC}"; git clone --depth 1 "$repo" 2>/dev/null || true; } || echo -e "${GREEN} βœ“ ${name}${NC}"
105
+ done
106
+
107
+ for dir in ComfyUI-Impact-Pack ComfyUI-ReActor; do
108
+ [ -f "$dir/requirements.txt" ] && pip install -r "$dir/requirements.txt" --break-system-packages -q 2>/dev/null || true
109
+ done
110
+
111
+ # Remove broken GroundingDino if exists
112
+ rm -rf ComfyUI-GroundingDino 2>/dev/null || true
113
+
114
+ # Install onnxruntime-gpu for ReActor
115
+ pip install onnxruntime-gpu --break-system-packages -q 2>/dev/null || true
116
+
117
+ # Fix numpy compatibility
118
+ pip install "numpy<2.4" --break-system-packages -q 2>/dev/null || true
119
+
120
+ # ═══════════════════════════════════════════════════════════════════════════════
121
+ # FLUX MODELS (from mirror)
122
+ # ═══════════════════════════════════════════════════════════════════════════════
123
+ echo -e "\n${YELLOW}[3/7] FLUX Models...${NC}"
124
+
125
+ echo -e "\n${MAGENTA}═══ Checkpoints ═══${NC}"
126
+ dl "$MIRROR/checkpoints/flux/fluxed-up-7.1-fp16.safetensors" \
127
+ "$COMFY_DIR/models/checkpoints/fluxed-up-7.1-fp16.safetensors" \
128
+ "Fluxed Up 7.1"
129
+
130
+ echo -e "\n${MAGENTA}═══ FLUX.1 Kontext Dev ═══${NC}"
131
+ dl "https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev/resolve/main/flux1-kontext-dev.safetensors" \
132
+ "$COMFY_DIR/models/diffusion_models/flux1-kontext-dev.safetensors" \
133
+ "FLUX.1 Kontext Dev"
134
+
135
+ echo -e "\n${MAGENTA}═══ FLUX.2 Klein 9B ═══${NC}"
136
+ dl "https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9b-fp8/resolve/main/flux-2-klein-base-9b-fp8.safetensors" \
137
+ "$COMFY_DIR/models/unet/flux-2-klein-base-9b-fp8.safetensors" \
138
+ "FLUX.2 Klein 9B"
139
+
140
+ dl "https://huggingface.co/Comfy-Org/flux2-klein-9B/resolve/main/split_files/text_encoders/qwen_3_8b_fp8mixed.safetensors" \
141
+ "$COMFY_DIR/models/text_encoders/qwen_3_8b_fp8mixed.safetensors" \
142
+ "Qwen 3 8B"
143
+
144
+ echo -e "\n${MAGENTA}═══ FLUX.2 Dev ═══${NC}"
145
+ dl "https://huggingface.co/black-forest-labs/FLUX.2-dev/resolve/main/flux2-dev.safetensors" \
146
+ "$COMFY_DIR/models/diffusion_models/flux2-dev.safetensors" \
147
+ "FLUX.2 Dev"
148
+
149
+ dl "https://huggingface.co/Comfy-Org/flux2-dev/resolve/main/split_files/text_encoders/mistral_3_small_flux2_bf16.safetensors" \
150
+ "$COMFY_DIR/models/text_encoders/mistral_3_small_flux2_bf16.safetensors" \
151
+ "Mistral 3 Small"
152
+
153
+ echo -e "\n${MAGENTA}═══ CLIP & VAE ═══${NC}"
154
+ dl "https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors" \
155
+ "$COMFY_DIR/models/clip/clip_l.safetensors" \
156
+ "CLIP-L"
157
+
158
+ dl "https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp8_e4m3fn.safetensors" \
159
+ "$COMFY_DIR/models/clip/t5xxl_fp8_e4m3fn.safetensors" \
160
+ "T5-XXL FP8"
161
+
162
+ dl "https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/ae.safetensors" \
163
+ "$COMFY_DIR/models/vae/ae.safetensors" \
164
+ "FLUX.1 VAE"
165
+
166
+ dl "https://huggingface.co/Comfy-Org/flux2-dev/resolve/main/split_files/vae/flux2-vae.safetensors" \
167
+ "$COMFY_DIR/models/vae/flux2-vae.safetensors" \
168
+ "FLUX.2 VAE"
169
+
170
+ # ═══════════════════════════════════════════════════════════════════════════════
171
+ # LORAS (from mirror)
172
+ # ═══════════════════════════════════════════════════════════════════════════════
173
+ echo -e "\n${YELLOW}[4/7] LoRAs...${NC}"
174
+
175
+ echo -e "${MAGENTA}═══ Flux.1 Dev LoRAs ═══${NC}"
176
+ for lora in flux1dev_nudity_female_v2 flux1dev_anatomy_female flux1dev_nipple_default flux1dev_pussy_default; do
177
+ dl "$MIRROR/loras/flux1dev/${lora}.safetensors" \
178
+ "$COMFY_DIR/models/loras/${lora}.safetensors" \
179
+ "$lora"
180
+ done
181
+
182
+ echo -e "\n${MAGENTA}═══ Flux.2 Klein LoRAs ═══${NC}"
183
+ for lora in flux2klein_nsfw flux2klein_nipple flux2klein_pussy flux2klein_body_version_a flux2klein_style_2000s; do
184
+ dl "$MIRROR/loras/flux2klein/${lora}.safetensors" \
185
+ "$COMFY_DIR/models/loras/${lora}.safetensors" \
186
+ "$lora"
187
+ done
188
+
189
+ echo -e "\n${MAGENTA}═══ Kontext LoRAs ═══${NC}"
190
+ dl "$MIRROR/loras/kontext/clothes_remover_v0.safetensors" \
191
+ "$COMFY_DIR/models/loras/clothes_remover_v0.safetensors" \
192
+ "Clothes Remover v0"
193
+
194
+ # ═══════════════════════════════════════════════════════════���═══════════════════
195
+ # REACTOR & DETECTORS (from mirror)
196
+ # ═══════════════════════════════════════════════════════════════════════════════
197
+ echo -e "\n${YELLOW}[5/7] ReActor & Detectors...${NC}"
198
+
199
+ echo -e "${MAGENTA}═══ Face Swap ═══${NC}"
200
+ dl "$MIRROR/swappers/reswapper_128.onnx" \
201
+ "$COMFY_DIR/models/insightface/inswapper_128.onnx" \
202
+ "Inswapper 128"
203
+
204
+ dl "$MIRROR/facerestore/GFPGANv1.4.pth" \
205
+ "$COMFY_DIR/models/facerestore_models/GFPGANv1.4.pth" \
206
+ "GFPGAN v1.4"
207
+
208
+ dl "$MIRROR/facerestore/codeformer.pth" \
209
+ "$COMFY_DIR/models/facerestore_models/codeformer.pth" \
210
+ "CodeFormer"
211
+
212
+ echo -e "\n${MAGENTA}═══ InsightFace buffalo_l ═══${NC}"
213
+ for f in 1k3d68.onnx 2d106det.onnx det_10g.onnx genderage.onnx w600k_r50.onnx; do
214
+ dl "$MIRROR/insightface/buffalo_l/$f" \
215
+ "$COMFY_DIR/models/insightface/models/buffalo_l/$f" \
216
+ "buffalo_l/$f"
217
+ done
218
+
219
+ echo -e "\n${MAGENTA}═══ Detectors ═══${NC}"
220
+ dl "$MIRROR/detection/face_yolov8m.pt" \
221
+ "$COMFY_DIR/models/ultralytics/bbox/face_yolov8m.pt" \
222
+ "Face YOLOv8m"
223
+
224
+ dl "$MIRROR/detection/hand_yolov8s.pt" \
225
+ "$COMFY_DIR/models/ultralytics/bbox/hand_yolov8s.pt" \
226
+ "Hand YOLOv8s"
227
+
228
+ dl "$MIRROR/detection/person_yolov8s-seg.pt" \
229
+ "$COMFY_DIR/models/ultralytics/segm/person_yolov8s-seg.pt" \
230
+ "Person YOLOv8s-seg"
231
+
232
+ dl "$MIRROR/detection/sam_vit_l_0b3195.pth" \
233
+ "$COMFY_DIR/models/sams/sam_vit_l_0b3195.pth" \
234
+ "SAM ViT-L"
235
+
236
+ echo -e "\n${MAGENTA}═══ Upscaler ═══${NC}"
237
+ dl "$MIRROR/upscalers/4x_NMKD-Siax_200k.pth" \
238
+ "$COMFY_DIR/models/upscale_models/4x_NMKD-Siax_200k.pth" \
239
+ "4x NMKD-Siax"
240
+
241
+ # ═══════════════════════════════════════════════════════════════════════════════
242
+ # WORKFLOW
243
+ # ═══════════════════════════════════════════════════════════════════════════════
244
+ echo -e "\n${YELLOW}[6/7] Workflow...${NC}"
245
+ dl "https://huggingface.co/msrcam/ComfyUI_AutoInstallers/resolve/main/installers/nudify/Flux_Ultimate_Nudify_v1.14.json" \
246
+ "$COMFY_DIR/user/default/workflows/Flux_Ultimate_Nudify.json" \
247
+ "Workflow v1.14"
248
+
249
+ # ═══════════════════════════════════════════════════════════════════════════════
250
+ # SYMLINKS for Impact Pack paths
251
+ # ═══════════════════════════════════════════════════════════════════════════════
252
+ echo -e "\n${YELLOW}[7/7] Creating symlinks...${NC}"
253
+ cd "$COMFY_DIR/models"
254
+
255
+ # SAM
256
+ [ ! -L "sams/sam_vit_l_0b3195.pth" ] && [ -f "sams/sam_vit_l_0b3195.pth" ] || true
257
+
258
+ # Ultralytics expects specific paths
259
+ ln -sf "$COMFY_DIR/models/ultralytics/bbox/face_yolov8m.pt" "$COMFY_DIR/models/ultralytics/face_yolov8m.pt" 2>/dev/null || true
260
+ ln -sf "$COMFY_DIR/models/ultralytics/bbox/hand_yolov8s.pt" "$COMFY_DIR/models/ultralytics/hand_yolov8s.pt" 2>/dev/null || true
261
+
262
+ echo -e "${GREEN}βœ“ Symlinks created${NC}"
263
+
264
+ # ═══════════════════════════════════════════════════════════════════════════════
265
+ # DONE
266
+ # ═══════════════════════════════════════════════════════════════════════════════
267
+ echo -e "\n${GREEN}═══════════════════════════════════════════════════════════════════════════════${NC}"
268
+ echo -e "${GREEN} βœ“ FLUX Ultimate Nudify v0.24 - Complete!${NC}"
269
+ echo -e "${GREEN}═══════════════════════════════════════════════════════════════════════════════${NC}"
270
+
271
+ echo -e "\n${CYAN}Start ComfyUI:${NC}"
272
+ echo " cd $COMFY_DIR && python main.py --listen 0.0.0.0 --port 8188"
273
+ echo ""