Update setup_comfy_wanDANCE.sh
Browse files- setup_comfy_wanDANCE.sh +94 -5
setup_comfy_wanDANCE.sh
CHANGED
|
@@ -56,11 +56,14 @@ readonly DOWNLOAD_FILES=(
|
|
| 56 |
"https://huggingface.co/ABDALLALSWAITI/Upscalers/resolve/main/anime/2x-AnimeSharpV2_MoSR_Soft.pth|upscale_models|2x-AnimeSharpV2_MoSR_Soft.pth"
|
| 57 |
# Civitai model
|
| 58 |
#"https://civitai.com/api/download/models/2122278?type=Model&format=SafeTensor&size=pruned&fp=fp16|checkpoints|raehoshiIllustXL_v60.safetensors"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
)
|
| 60 |
|
| 61 |
# Custom nodes para instalar
|
| 62 |
readonly CUSTOM_NODES=(
|
| 63 |
-
"https://github.com/kijai/ComfyUI-Florence2"
|
| 64 |
"https://github.com/kijai/ComfyUI-WanVideoWrapper"
|
| 65 |
"https://github.com/Fannovel16/ComfyUI-Frame-Interpolation"
|
| 66 |
"https://github.com/kijai/ComfyUI-GIMM-VFI"
|
|
@@ -68,9 +71,9 @@ readonly CUSTOM_NODES=(
|
|
| 68 |
"https://github.com/kijai/ComfyUI-KJNodes"
|
| 69 |
"https://github.com/Fannovel16/comfyui_controlnet_aux"
|
| 70 |
"https://github.com/Artificial-Sweetener/comfyui-WhiteRabbit"
|
| 71 |
-
"https://github.com/
|
|
|
|
| 72 |
"https://github.com/CoreyCorza/ComfyUI-CRZnodes"
|
| 73 |
-
"https://github.com/yuvraj108c/ComfyUI-Dwpose-Tensorrt"
|
| 74 |
"https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes"
|
| 75 |
"https://github.com/grmchn/ComfyUI-ProportionChanger"
|
| 76 |
)
|
|
@@ -160,6 +163,89 @@ download_hf() {
|
|
| 160 |
return 1
|
| 161 |
}
|
| 162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
# Download genérico com aria2c, wget ou curl
|
| 164 |
download_file() {
|
| 165 |
local url="$1"
|
|
@@ -248,12 +334,15 @@ process_downloads() {
|
|
| 248 |
if [[ "$url" == hf://* ]]; then
|
| 249 |
# HuggingFace download
|
| 250 |
url="${url#hf://}" # Remove prefixo hf://
|
| 251 |
-
|
| 252 |
# Separar repo e caminho do arquivo
|
| 253 |
local repo=$(echo "$url" | cut -d'/' -f1-2)
|
| 254 |
local file_path=$(echo "$url" | cut -d'/' -f3-)
|
| 255 |
-
|
| 256 |
download_hf "$repo" "$file_path" "$target_dir" "$filename" || ((failed_count++))
|
|
|
|
|
|
|
|
|
|
| 257 |
else
|
| 258 |
# Download normal (HTTP/HTTPS)
|
| 259 |
download_file "$url" "$target_dir" "$filename" || ((failed_count++))
|
|
|
|
| 56 |
"https://huggingface.co/ABDALLALSWAITI/Upscalers/resolve/main/anime/2x-AnimeSharpV2_MoSR_Soft.pth|upscale_models|2x-AnimeSharpV2_MoSR_Soft.pth"
|
| 57 |
# Civitai model
|
| 58 |
#"https://civitai.com/api/download/models/2122278?type=Model&format=SafeTensor&size=pruned&fp=fp16|checkpoints|raehoshiIllustXL_v60.safetensors"
|
| 59 |
+
# MEGA downloads (modelos adicionais)
|
| 60 |
+
"mega://5QRxDDII#MVIEGduGgTDS0DkanTiPQso0O4Im-Ph5QR0JGPbox0M|loras|mega_model_1.safetensors"
|
| 61 |
+
"mega://8ZQgjZQR#EZav6GgFTX7amc41PGHAM3FOKaTOlfjrvLWs8XpdPNY|loras|mega_model_2.safetensors"
|
| 62 |
+
"mega://lQRB1ZhT#IBoYK1DJCILHl4ILEgIYUZBVmC2pii-PqtLH38bwJqY|loras|mega_model_3.safetensors"
|
| 63 |
)
|
| 64 |
|
| 65 |
# Custom nodes para instalar
|
| 66 |
readonly CUSTOM_NODES=(
|
|
|
|
| 67 |
"https://github.com/kijai/ComfyUI-WanVideoWrapper"
|
| 68 |
"https://github.com/Fannovel16/ComfyUI-Frame-Interpolation"
|
| 69 |
"https://github.com/kijai/ComfyUI-GIMM-VFI"
|
|
|
|
| 71 |
"https://github.com/kijai/ComfyUI-KJNodes"
|
| 72 |
"https://github.com/Fannovel16/comfyui_controlnet_aux"
|
| 73 |
"https://github.com/Artificial-Sweetener/comfyui-WhiteRabbit"
|
| 74 |
+
"https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes"
|
| 75 |
+
"https://github.com/yuvraj108c/ComfyUI-Upscaler-Tensorrt"
|
| 76 |
"https://github.com/CoreyCorza/ComfyUI-CRZnodes"
|
|
|
|
| 77 |
"https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes"
|
| 78 |
"https://github.com/grmchn/ComfyUI-ProportionChanger"
|
| 79 |
)
|
|
|
|
| 163 |
return 1
|
| 164 |
}
|
| 165 |
|
| 166 |
+
# Download do MEGA com retry e verificação
|
| 167 |
+
download_mega() {
|
| 168 |
+
local mega_url="$1"
|
| 169 |
+
local target_dir="$2"
|
| 170 |
+
local filename="$3"
|
| 171 |
+
local max_retries=3
|
| 172 |
+
local retry_count=0
|
| 173 |
+
|
| 174 |
+
# Extrair ID e key do URL MEGA
|
| 175 |
+
local file_id=$(echo "$mega_url" | sed 's/mega:\/\///' | cut -d'#' -f1)
|
| 176 |
+
local file_key=$(echo "$mega_url" | cut -d'#' -f2)
|
| 177 |
+
|
| 178 |
+
# Construir URL completo do MEGA
|
| 179 |
+
local full_mega_url="https://mega.nz/file/${file_id}#${file_key}"
|
| 180 |
+
|
| 181 |
+
local target_file="$target_dir/$filename"
|
| 182 |
+
|
| 183 |
+
# Se arquivo já existe e tem tamanho razoável, pular
|
| 184 |
+
if [ -f "$target_file" ] && [ $(stat -c%s "$target_file" 2>/dev/null || echo 0) -gt 1000000 ]; then
|
| 185 |
+
log_success "Arquivo MEGA já existe: $filename"
|
| 186 |
+
return 0
|
| 187 |
+
fi
|
| 188 |
+
|
| 189 |
+
log_info "Baixando do MEGA: $filename"
|
| 190 |
+
log_info " URL: $full_mega_url"
|
| 191 |
+
|
| 192 |
+
# Instalar megatools se não existir
|
| 193 |
+
if ! command_exists megadl; then
|
| 194 |
+
log_info "Instalando megatools..."
|
| 195 |
+
apt-get update -y -qq 2>/dev/null
|
| 196 |
+
apt-get install -y -qq megatools 2>/dev/null
|
| 197 |
+
|
| 198 |
+
if ! command_exists megadl; then
|
| 199 |
+
log_error "Falha ao instalar megatools!"
|
| 200 |
+
return 1
|
| 201 |
+
fi
|
| 202 |
+
fi
|
| 203 |
+
|
| 204 |
+
# Tentar baixar com retry
|
| 205 |
+
while [ $retry_count -lt $max_retries ]; do
|
| 206 |
+
retry_count=$((retry_count + 1))
|
| 207 |
+
log_info "Tentativa $retry_count de $max_retries..."
|
| 208 |
+
|
| 209 |
+
# Criar diretório temporário para download
|
| 210 |
+
local temp_dir=$(mktemp -d)
|
| 211 |
+
cd "$temp_dir"
|
| 212 |
+
|
| 213 |
+
# Tentar download com megadl
|
| 214 |
+
if megadl "$full_mega_url" 2>/dev/null; then
|
| 215 |
+
# Procurar arquivo baixado
|
| 216 |
+
local downloaded_file=$(find . -type f \( -name "*.safetensors" -o -name "*.pth" -o -name "*.pt" -o -name "*.bin" \) 2>/dev/null | head -1)
|
| 217 |
+
|
| 218 |
+
if [ -n "$downloaded_file" ]; then
|
| 219 |
+
# Verificar tamanho do arquivo
|
| 220 |
+
local file_size=$(stat -c%s "$downloaded_file" 2>/dev/null || echo 0)
|
| 221 |
+
if [ $file_size -gt 1000000 ]; then
|
| 222 |
+
# Mover para destino
|
| 223 |
+
mv "$downloaded_file" "$target_file"
|
| 224 |
+
cd - >/dev/null
|
| 225 |
+
rm -rf "$temp_dir"
|
| 226 |
+
log_success "Download MEGA concluído: $filename ($(numfmt --to=iec-i --suffix=B $file_size))"
|
| 227 |
+
return 0
|
| 228 |
+
else
|
| 229 |
+
log_warn "Arquivo baixado muito pequeno, tentando novamente..."
|
| 230 |
+
fi
|
| 231 |
+
fi
|
| 232 |
+
else
|
| 233 |
+
log_warn "Falha no download com megadl"
|
| 234 |
+
fi
|
| 235 |
+
|
| 236 |
+
cd - >/dev/null
|
| 237 |
+
rm -rf "$temp_dir"
|
| 238 |
+
|
| 239 |
+
if [ $retry_count -lt $max_retries ]; then
|
| 240 |
+
log_info "Aguardando 5 segundos antes de tentar novamente..."
|
| 241 |
+
sleep 5
|
| 242 |
+
fi
|
| 243 |
+
done
|
| 244 |
+
|
| 245 |
+
log_error "Falha após $max_retries tentativas: $filename"
|
| 246 |
+
return 1
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
# Download genérico com aria2c, wget ou curl
|
| 250 |
download_file() {
|
| 251 |
local url="$1"
|
|
|
|
| 334 |
if [[ "$url" == hf://* ]]; then
|
| 335 |
# HuggingFace download
|
| 336 |
url="${url#hf://}" # Remove prefixo hf://
|
| 337 |
+
|
| 338 |
# Separar repo e caminho do arquivo
|
| 339 |
local repo=$(echo "$url" | cut -d'/' -f1-2)
|
| 340 |
local file_path=$(echo "$url" | cut -d'/' -f3-)
|
| 341 |
+
|
| 342 |
download_hf "$repo" "$file_path" "$target_dir" "$filename" || ((failed_count++))
|
| 343 |
+
elif [[ "$url" == mega://* ]]; then
|
| 344 |
+
# MEGA download
|
| 345 |
+
download_mega "$url" "$target_dir" "$filename" || ((failed_count++))
|
| 346 |
else
|
| 347 |
# Download normal (HTTP/HTTPS)
|
| 348 |
download_file "$url" "$target_dir" "$filename" || ((failed_count++))
|