Simplify download script - use curl instead of wget

- Remove ANSI color codes causing display issues
- Use curl with progress-bar for cleaner output
- Fix Juggernaut URL (v8 instead of non-existent v9)
- Remove problematic clear command
- Ultra-simple text interface
This commit is contained in:
Folzo
2026-04-06 01:36:59 +02:00
parent 913cdd6424
commit 828ab546d6
+71 -218
View File
@@ -1,34 +1,17 @@
#!/bin/bash #!/bin/bash
# Script de téléchargement des meilleurs modèles SDXL # Script de téléchargement des meilleurs modèles SDXL
# Pour ComfyUI avec RX 7800 XT # Pour ComfyUI avec RX 7800 XT
# Version propre avec suivi clair # Version ultra-simple
set -e set -e
# Détection robuste du répertoire du script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MODELS_DIR="$SCRIPT_DIR/models/checkpoints" MODELS_DIR="$SCRIPT_DIR/models/checkpoints"
VAE_DIR="$SCRIPT_DIR/models/vae" VAE_DIR="$SCRIPT_DIR/models/vae"
mkdir -p "$MODELS_DIR" "$VAE_DIR" mkdir -p "$MODELS_DIR" "$VAE_DIR"
# Couleurs pour l'affichage # Fonction simple
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# Fonction d'affichage d'en-tête
print_header() {
echo ""
echo "========================================"
echo "$1"
echo "========================================"
echo ""
}
# Fonction de téléchargement simple et propre
download_model() { download_model() {
local url=$1 local url=$1
local output=$2 local output=$2
@@ -37,280 +20,150 @@ download_model() {
if [ -f "$output" ]; then if [ -f "$output" ]; then
local filesize=$(du -h "$output" | cut -f1) local filesize=$(du -h "$output" | cut -f1)
echo -e "${GREEN}✓${NC} $name déjà présent ($filesize)" echo "[OK] $name deja present ($filesize)"
return 0 return 0
fi fi
echo -e "${BLUE}📥${NC} Téléchargement de $name ($size)..." echo ""
echo " Destination: $(basename "$output")" echo "----------------------------------------"
echo "Telechargement: $name ($size)"
echo "Fichier: $(basename "$output")"
echo "----------------------------------------"
echo "Patientez... (ne quittez pas)"
echo "" echo ""
# Téléchargement avec progression simple # Telechargement avec curl (plus propre que wget)
if wget --show-progress --progress=dot:giga -O "$output" "$url" 2>&1; then if curl -L --progress-bar "$url" -o "$output" 2>&1; then
echo "" echo ""
echo -e "${GREEN}✓${NC} $name téléchargé avec succès" echo "[OK] $name telecharge avec succes"
return 0 return 0
else else
echo "" echo ""
echo -e "${RED}✗${NC} Erreur lors du téléchargement de $name" echo "[ERREUR] Probleme lors du telechargement de $name"
rm -f "$output" rm -f "$output"
return 1 return 1
fi fi
} }
# Affichage d'accueil # Verif permissions
clear if [ ! -w "$MODELS_DIR" ]; then
print_header "🎨 GESTIONNAIRE DE MODÈLES SDXL" echo "[ERREUR] Pas de permission d'ecriture dans $MODELS_DIR"
echo "Répertoire des modèles: $MODELS_DIR" echo "Execute: sudo chown -R \$USER:\$USER $MODELS_DIR"
echo "Espace disque disponible: $(df -h "$MODELS_DIR" | tail -1 | awk '{print $4}')" exit 1
echo "" fi
echo "Espace requis estimé:"
echo " • 1 modèle: ~7 GB"
echo " • 3 modèles: ~21 GB"
echo " • Tous les modèles: ~35 GB"
echo ""
read -p "Appuyez sur Entrée pour continuer..."
# Menu principal # Menu
clear clear
print_header "📋 MENU PRINCIPAL" echo "=========================================="
echo " GESTIONNAIRE DE MODELES SDXL"
echo "=== MODÈLES PHOTORÉALISTES ===" echo "=========================================="
echo "" echo ""
echo "1) RealVisXL V4.0 (6.9GB)" echo "Dossier: $MODELS_DIR"
echo " Portraits ultra-réalistes, peau détaillée" echo "Espace dispo: $(df -h "$MODELS_DIR" | tail -1 | awk '{print $4}')"
echo "" echo ""
echo "2) Juggernaut XL v9 (6.9GB)" echo "MODELES DISPONIBLES:"
echo " Polyvalent, excellent pour tout type d'image"
echo "" echo ""
echo "3) Proteus V0.4 (6.9GB)" echo " 1) RealVisXL V4.0 - Portraits realistes"
echo " Photoréalisme amélioré, excellente qualité" echo " 2) Juggernaut XL v8 - Polyvalent"
echo " 3) DreamShaper XL 1.0 - Art/Fantasy"
echo " 4) SDXL Lightning - Rapide (8 etapes)"
echo " 5) SDXL Base 1.0 - Modele de base"
echo " 6) SDXL VAE - Meilleures couleurs"
echo "" echo ""
echo "=== MODÈLES ART/STYLISÉS ===" echo " 8) TOUT TELECHARGER - ~28GB total"
echo " 0) Quitter"
echo "" echo ""
echo "4) DreamShaper XL 1.0 (6.9GB)" echo "=========================================="
echo " Art fantastique, peinture, illustration"
echo ""
echo "5) SDXL Base 1.0 (6.9GB)"
echo " Modèle de base Stability AI (déjà installé)"
echo ""
echo "=== MODÈLES RAPIDES ==="
echo ""
echo "6) SDXL Lightning 8-step (6.9GB)"
echo " Génération 4x plus rapide, 8 étapes seulement"
echo ""
echo "=== COMPOSANTS ==="
echo ""
echo "7) SDXL VAE (335MB)"
echo " Meilleure qualité de couleurs pour tous les modèles"
echo ""
echo "=== INSTALLATION MASSIVE ==="
echo ""
echo "8) TOUT TÉLÉCHARGER (~35GB)"
echo " Tous les modèles ci-dessus"
echo ""
echo "0) Quitter"
echo ""
echo "========================================"
read -p "Votre choix (0-8): " choice read -p "Votre choix (0-8): " choice
# Traitement du choix
case $choice in case $choice in
1) 1)
clear
print_header "📥 TÉLÉCHARGEMENT: RealVisXL V4.0"
download_model \ download_model \
"https://huggingface.co/SG161222/RealVisXL_V4.0/resolve/main/RealVisXL_V4.0.safetensors" \ "https://huggingface.co/SG161222/RealVisXL_V4.0/resolve/main/RealVisXL_V4.0.safetensors" \
"$MODELS_DIR/RealVisXL_V4.0.safetensors" \ "$MODELS_DIR/RealVisXL_V4.0.safetensors" \
"RealVisXL V4.0" \ "RealVisXL V4.0" \
"6.9GB" "6.9GB"
echo ""
echo -e "${YELLOW}💡 Conseil d'utilisation:${NC}"
echo " • Parfait pour les portraits"
echo " • Prompt: 'professional photo, 8k uhd, dslr, soft lighting'"
echo " • Étapes: 40-50, CFG: 7-8"
;; ;;
2) 2)
clear
print_header "📥 TÉLÉCHARGEMENT: Juggernaut XL v9"
download_model \ download_model \
"https://huggingface.co/RunDiffusion/Juggernaut-XL-v9/resolve/main/Juggernaut-XL-v9.safetensors" \ "https://huggingface.co/RunDiffusion/Juggernaut-XL-v8/resolve/main/juggernautXL_v8Rundiffusion.safetensors" \
"$MODELS_DIR/Juggernaut-XL-v9.safetensors" \ "$MODELS_DIR/juggernautXL_v8Rundiffusion.safetensors" \
"Juggernaut XL v9" \ "Juggernaut XL v8" \
"6.9GB" "6.9GB"
echo ""
echo -e "${YELLOW}💡 Conseil d'utilisation:${NC}"
echo " • Modèle polyvalent quotidien"
echo " • Fonctionne avec tous les styles"
echo " • Étapes: 30-40, CFG: 7-8"
;; ;;
3) 3)
clear
print_header "📥 TÉLÉCHARGEMENT: Proteus V0.4"
download_model \
"https://huggingface.co/dathudehenry/ProteusV0.4/resolve/main/ProteusV0.4.safetensors" \
"$MODELS_DIR/ProteusV0.4.safetensors" \
"Proteus V0.4" \
"6.9GB"
echo ""
echo -e "${YELLOW}💡 Conseil d'utilisation:${NC}"
echo " • Excellente texture de peau"
echo " • Prompt: 'raw photo, realistic, detailed skin texture'"
echo " • Étapes: 30-40, CFG: 6-7"
;;
4)
clear
print_header "📥 TÉLÉCHARGEMENT: DreamShaper XL 1.0"
download_model \ download_model \
"https://huggingface.co/Lykon/DreamShaper/resolve/main/DreamShaperXL1.0.safetensors" \ "https://huggingface.co/Lykon/DreamShaper/resolve/main/DreamShaperXL1.0.safetensors" \
"$MODELS_DIR/DreamShaperXL1.0.safetensors" \ "$MODELS_DIR/DreamShaperXL1.0.safetensors" \
"DreamShaper XL 1.0" \ "DreamShaper XL 1.0" \
"6.9GB" "6.9GB"
echo "" ;;
echo -e "${YELLOW}💡 Conseil d'utilisation:${NC}" 4)
echo " • Art, fantasy, illustrations" download_model \
echo " • Prompt: 'digital art, concept art, highly detailed'" "https://huggingface.co/ByteDance/SDXL-Lightning/resolve/main/sdxl_lightning_8step.safetensors" \
echo " • Étapes: 30-40, CFG: 7-8" "$MODELS_DIR/sdxl_lightning_8step.safetensors" \
"SDXL Lightning 8-step" \
"6.9GB"
;; ;;
5) 5)
clear
print_header "📥 TÉLÉCHARGEMENT: SDXL Base 1.0"
download_model \ download_model \
"https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors" \ "https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors" \
"$MODELS_DIR/sd_xl_base_1.0.safetensors" \ "$MODELS_DIR/sd_xl_base_1.0.safetensors" \
"SDXL Base 1.0" \ "SDXL Base 1.0" \
"6.9GB" "6.9GB"
echo ""
echo -e "${YELLOW}💡 Conseil d'utilisation:${NC}"
echo " • Modèle officiel Stability AI"
echo " • Très stable et prévisible"
echo " • Étapes: 30-40, CFG: 7-8"
;; ;;
6) 6)
clear
print_header "📥 TÉLÉCHARGEMENT: SDXL Lightning"
download_model \
"https://huggingface.co/ByteDance/SDXL-Lightning/resolve/main/sdxl_lightning_8step.safetensors" \
"$MODELS_DIR/sdxl_lightning_8step.safetensors" \
"SDXL Lightning 8-step" \
"6.9GB"
echo ""
echo -e "${YELLOW}⚠️ IMPORTANT - Réglages spéciaux:${NC}"
echo " • Étapes: 8 (OBLIGATOIRE)"
echo " • CFG: 1-2 (TRÈS BAS)"
echo " • 4x plus rapide que les autres modèles"
;;
7)
clear
print_header "📥 TÉLÉCHARGEMENT: SDXL VAE"
download_model \ download_model \
"https://huggingface.co/stabilityai/sdxl-vae/resolve/main/diffusion_pytorch_model.safetensors" \ "https://huggingface.co/stabilityai/sdxl-vae/resolve/main/diffusion_pytorch_model.safetensors" \
"$VAE_DIR/sdxl_vae.safetensors" \ "$VAE_DIR/sdxl_vae.safetensors" \
"SDXL VAE" \ "SDXL VAE" \
"335MB" "335MB"
echo ""
echo -e "${YELLOW}💡 Conseil d'utilisation:${NC}"
echo " • À utiliser avec tous les modèles SDXL"
echo " • Améliore les couleurs et détails"
echo " • Chargez-le dans le node 'Load VAE' de ComfyUI"
;; ;;
8) 8)
clear
print_header "📥 TÉLÉCHARGEMENT COMPLET"
echo "Cela va télécharger ~35GB de modèles"
echo "" echo ""
read -p "Êtes-vous sûr ? (tapez 'oui' pour confirmer): " confirm echo "=========================================="
echo " TELECHARGEMENT DE TOUS LES MODELES"
echo " (~28GB au total)"
echo "=========================================="
read -p "Confirmer (tapez 'oui'): " confirm
if [ "$confirm" = "oui" ]; then if [ "$confirm" = "oui" ]; then
download_model "https://huggingface.co/SG161222/RealVisXL_V4.0/resolve/main/RealVisXL_V4.0.safetensors" "$MODELS_DIR/RealVisXL_V4.0.safetensors" "RealVisXL V4.0" "6.9GB"
download_model "https://huggingface.co/RunDiffusion/Juggernaut-XL-v8/resolve/main/juggernautXL_v8Rundiffusion.safetensors" "$MODELS_DIR/juggernautXL_v8Rundiffusion.safetensors" "Juggernaut XL v8" "6.9GB"
download_model "https://huggingface.co/Lykon/DreamShaper/resolve/main/DreamShaperXL1.0.safetensors" "$MODELS_DIR/DreamShaperXL1.0.safetensors" "DreamShaper XL 1.0" "6.9GB"
download_model "https://huggingface.co/ByteDance/SDXL-Lightning/resolve/main/sdxl_lightning_8step.safetensors" "$MODELS_DIR/sdxl_lightning_8step.safetensors" "SDXL Lightning 8-step" "6.9GB"
download_model "https://huggingface.co/stabilityai/sdxl-vae/resolve/main/diffusion_pytorch_model.safetensors" "$VAE_DIR/sdxl_vae.safetensors" "SDXL VAE" "335MB"
echo "" echo ""
echo "Démarrage du téléchargement de tous les modèles..." echo "=========================================="
echo "" echo " [OK] TOUS LES MODELES TELECHARGES"
echo "=========================================="
download_model \
"https://huggingface.co/SG161222/RealVisXL_V4.0/resolve/main/RealVisXL_V4.0.safetensors" \
"$MODELS_DIR/RealVisXL_V4.0.safetensors" \
"RealVisXL V4.0" \
"6.9GB"
echo ""
download_model \
"https://huggingface.co/RunDiffusion/Juggernaut-XL-v9/resolve/main/Juggernaut-XL-v9.safetensors" \
"$MODELS_DIR/Juggernaut-XL-v9.safetensors" \
"Juggernaut XL v9" \
"6.9GB"
echo ""
download_model \
"https://huggingface.co/dathudehenry/ProteusV0.4/resolve/main/ProteusV0.4.safetensors" \
"$MODELS_DIR/ProteusV0.4.safetensors" \
"Proteus V0.4" \
"6.9GB"
echo ""
download_model \
"https://huggingface.co/Lykon/DreamShaper/resolve/main/DreamShaperXL1.0.safetensors" \
"$MODELS_DIR/DreamShaperXL1.0.safetensors" \
"DreamShaper XL 1.0" \
"6.9GB"
echo ""
download_model \
"https://huggingface.co/ByteDance/SDXL-Lightning/resolve/main/sdxl_lightning_8step.safetensors" \
"$MODELS_DIR/sdxl_lightning_8step.safetensors" \
"SDXL Lightning 8-step" \
"6.9GB"
echo ""
download_model \
"https://huggingface.co/stabilityai/sdxl-vae/resolve/main/diffusion_pytorch_model.safetensors" \
"$VAE_DIR/sdxl_vae.safetensors" \
"SDXL VAE" \
"335MB"
clear
print_header "✅ TOUS LES MODÈLES SONT TÉLÉCHARGÉS"
else else
echo ""
echo "Annulation..." echo "Annulation..."
exit 0 exit 0
fi fi
;; ;;
0) 0)
echo ""
echo "Au revoir !" echo "Au revoir !"
exit 0 exit 0
;; ;;
*) *)
echo "" echo "[ERREUR] Choix invalide"
echo -e "${RED}✗${NC} Choix invalide"
exit 1 exit 1
;; ;;
esac esac
# Récapitulatif final # Resume
clear
print_header "✅ TÉLÉCHARGEMENT TERMINÉ"
echo "📊 Modèles installés:"
ls -lh "$MODELS_DIR"/*.safetensors 2>/dev/null | awk '{print " • " $9 " (" $5 ")"}' || echo " (aucun)"
echo "" echo ""
echo "📊 VAE installés:" echo "=========================================="
ls -lh "$VAE_DIR"/*.safetensors 2>/dev/null | awk '{print " • " $9 " (" $5 ")"}' || echo " (aucun)" echo " RESUME"
echo "=========================================="
echo "" echo ""
echo -e "${GREEN}🚀 Prochaines étapes:${NC}" echo "Modeles disponibles:"
ls -lh "$MODELS_DIR"/*.safetensors 2>/dev/null | awk '{print " " $9 " (" $5 ")"}' || echo " Aucun"
echo "" echo ""
echo "1. Redémarrer ComfyUI:" echo "VAE disponibles:"
ls -lh "$VAE_DIR"/*.safetensors 2>/dev/null | awk '{print " " $9 " (" $5 ")"}' || echo " Aucun"
echo ""
echo "=========================================="
echo " Prochaine etape:"
echo " sudo docker restart comfyui" echo " sudo docker restart comfyui"
echo "" echo "=========================================="
echo "2. Dans OpenWebUI (http://192.168.1.27:3000):"
echo " Admin → Settings → Images"
echo ""
echo "3. Changer le nom du modèle:"
echo " • RealVisXL_V4.0.safetensors"
echo " • Juggernaut-XL-v9.safetensors"
echo " • DreamShaperXL1.0.safetensors"
echo " • sdxl_lightning_8step.safetensors"
echo ""
echo "4. Consulter la documentation:"
echo " comfyui/docs/MODELS.md"
echo ""
echo "========================================"