Update setup_comfy_wan222.sh
Browse files- setup_comfy_wan222.sh +24 -26
setup_comfy_wan222.sh
CHANGED
|
@@ -316,7 +316,7 @@ log_info "========================================="
|
|
| 316 |
echo ""
|
| 317 |
|
| 318 |
# [1] Verificar e instalar dependências
|
| 319 |
-
log_info "[1/
|
| 320 |
|
| 321 |
# Instalar aria2c do sistema se não existir
|
| 322 |
if ! command_exists aria2c; then
|
|
@@ -333,7 +333,7 @@ done
|
|
| 333 |
log_success "Dependências OK"
|
| 334 |
|
| 335 |
# [2] Atualizar pip e instalar ferramentas
|
| 336 |
-
log_info "[2/
|
| 337 |
python3 -m pip install --upgrade pip wheel setuptools -q
|
| 338 |
|
| 339 |
# Instalar huggingface_hub com hf_transfer
|
|
@@ -346,8 +346,13 @@ fi
|
|
| 346 |
|
| 347 |
log_success "Ferramentas instaladas"
|
| 348 |
|
| 349 |
-
# [3] Instalar
|
| 350 |
-
log_info "[3/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 351 |
if [ -f "$COMFY_DIR/main.py" ]; then
|
| 352 |
log_warn "ComfyUI já existe, pulando instalação base"
|
| 353 |
else
|
|
@@ -361,31 +366,24 @@ else
|
|
| 361 |
fi
|
| 362 |
log_success "ComfyUI instalado em: $COMFY_DIR"
|
| 363 |
|
| 364 |
-
# [
|
| 365 |
-
log_info "[
|
| 366 |
-
if command_exists nvcc; then
|
| 367 |
-
log_info "Instalando
|
| 368 |
-
python3 -m pip install "
|
| 369 |
-
|
| 370 |
-
SAGE_DIR="/tmp/SageAttention"
|
| 371 |
-
rm -rf "$SAGE_DIR"
|
| 372 |
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
python3 setup.py install 2>&1 | grep -E "(running|installing|copying)" || true
|
| 377 |
-
cd - > /dev/null
|
| 378 |
-
rm -rf "$SAGE_DIR"
|
| 379 |
-
log_success "SageAttention instalado"
|
| 380 |
else
|
| 381 |
-
log_warn "
|
| 382 |
fi
|
| 383 |
else
|
| 384 |
log_warn "CUDA não detectado, pulando SageAttention"
|
| 385 |
fi
|
| 386 |
|
| 387 |
-
# [
|
| 388 |
-
log_info "[
|
| 389 |
mkdir -p "$MODELS_DIR"/{diffusion_models,loras,vae,text_encoders,clip_vision,controlnet,upscale_models}
|
| 390 |
|
| 391 |
# Verificar ferramentas de download
|
|
@@ -402,8 +400,8 @@ else
|
|
| 402 |
log_warn "Alguns downloads falharam, mas continuando..."
|
| 403 |
fi
|
| 404 |
|
| 405 |
-
# [
|
| 406 |
-
log_info "[
|
| 407 |
CN_DIR="$COMFY_DIR/custom_nodes"
|
| 408 |
mkdir -p "$CN_DIR"
|
| 409 |
|
|
@@ -429,9 +427,9 @@ wait
|
|
| 429 |
|
| 430 |
log_success "Custom nodes instalados"
|
| 431 |
|
| 432 |
-
# [
|
| 433 |
echo ""
|
| 434 |
-
log_info "[
|
| 435 |
|
| 436 |
# Verificar arquivos principais
|
| 437 |
check_critical_files() {
|
|
|
|
| 316 |
echo ""
|
| 317 |
|
| 318 |
# [1] Verificar e instalar dependências
|
| 319 |
+
log_info "[1/8] Verificando e instalando dependências..."
|
| 320 |
|
| 321 |
# Instalar aria2c do sistema se não existir
|
| 322 |
if ! command_exists aria2c; then
|
|
|
|
| 333 |
log_success "Dependências OK"
|
| 334 |
|
| 335 |
# [2] Atualizar pip e instalar ferramentas
|
| 336 |
+
log_info "[2/8] Preparando ferramentas Python..."
|
| 337 |
python3 -m pip install --upgrade pip wheel setuptools -q
|
| 338 |
|
| 339 |
# Instalar huggingface_hub com hf_transfer
|
|
|
|
| 346 |
|
| 347 |
log_success "Ferramentas instaladas"
|
| 348 |
|
| 349 |
+
# [3] Instalar PyTorch com CUDA 12.8
|
| 350 |
+
log_info "[3/8] Instalando PyTorch com CUDA 12.8..."
|
| 351 |
+
python3 -m pip install --upgrade torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
|
| 352 |
+
log_success "PyTorch com CUDA 12.8 instalado"
|
| 353 |
+
|
| 354 |
+
# [4] Instalar ComfyUI
|
| 355 |
+
log_info "[4/8] Instalando ComfyUI..."
|
| 356 |
if [ -f "$COMFY_DIR/main.py" ]; then
|
| 357 |
log_warn "ComfyUI já existe, pulando instalação base"
|
| 358 |
else
|
|
|
|
| 366 |
fi
|
| 367 |
log_success "ComfyUI instalado em: $COMFY_DIR"
|
| 368 |
|
| 369 |
+
# [5] Instalar SageAttention (wheel pré-compilada)
|
| 370 |
+
log_info "[5/8] Instalando SageAttention..."
|
| 371 |
+
if command_exists nvcc || python3 -c "import torch; print(torch.cuda.is_available())" 2>/dev/null | grep -q "True"; then
|
| 372 |
+
log_info "Instalando SageAttention pré-compilada..."
|
| 373 |
+
python3 -m pip install "https://huggingface.co/adbrasi/comfywheel/resolve/main/sageattention-2.2.0-cp311-cp311-linux_x86_64.whl" -q
|
|
|
|
|
|
|
|
|
|
| 374 |
|
| 375 |
+
# Verificar instalação
|
| 376 |
+
if python3 -c "import sageattention" 2>/dev/null; then
|
| 377 |
+
log_success "SageAttention instalado com sucesso"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 378 |
else
|
| 379 |
+
log_warn "SageAttention instalado mas não pôde ser importado"
|
| 380 |
fi
|
| 381 |
else
|
| 382 |
log_warn "CUDA não detectado, pulando SageAttention"
|
| 383 |
fi
|
| 384 |
|
| 385 |
+
# [6] Baixar modelos
|
| 386 |
+
log_info "[6/8] Baixando modelos..."
|
| 387 |
mkdir -p "$MODELS_DIR"/{diffusion_models,loras,vae,text_encoders,clip_vision,controlnet,upscale_models}
|
| 388 |
|
| 389 |
# Verificar ferramentas de download
|
|
|
|
| 400 |
log_warn "Alguns downloads falharam, mas continuando..."
|
| 401 |
fi
|
| 402 |
|
| 403 |
+
# [7] Instalar custom nodes
|
| 404 |
+
log_info "[7/8] Instalando custom nodes..."
|
| 405 |
CN_DIR="$COMFY_DIR/custom_nodes"
|
| 406 |
mkdir -p "$CN_DIR"
|
| 407 |
|
|
|
|
| 427 |
|
| 428 |
log_success "Custom nodes instalados"
|
| 429 |
|
| 430 |
+
# [8] Verificação final
|
| 431 |
echo ""
|
| 432 |
+
log_info "[8/8] Verificando instalação..."
|
| 433 |
|
| 434 |
# Verificar arquivos principais
|
| 435 |
check_critical_files() {
|