Improve download script UI/UX

- Clean menu interface with clear headers
- No terminal clearing, all messages preserved
- Color-coded status messages (green/red/yellow)
- Step-by-step progress tracking
- Final summary with installed models list
- Better wget progress display without messy output
This commit is contained in:
Folzo
2026-04-06 01:23:28 +02:00
parent 22914c1e4d
commit 913cdd6424
+167 -62
View File
@@ -1,6 +1,7 @@
#!/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
set -e set -e
@@ -11,13 +12,23 @@ VAE_DIR="$SCRIPT_DIR/models/vae"
mkdir -p "$MODELS_DIR" "$VAE_DIR" mkdir -p "$MODELS_DIR" "$VAE_DIR"
echo "🎨 Téléchargement des modèles SDXL recommandés" # Couleurs pour l'affichage
echo "================================================" GREEN='\033[0;32m'
echo "" BLUE='\033[0;34m'
echo "Espace disque requis : ~25-35 GB au total" YELLOW='\033[1;33m'
echo "" RED='\033[0;31m'
NC='\033[0m' # No Color
# Fonction de téléchargement avec barre de progression # 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
@@ -25,156 +36,229 @@ download_model() {
local size=$4 local size=$4
if [ -f "$output" ]; then if [ -f "$output" ]; then
echo "✓ $name déjà présent ($(du -h "$output" | cut -f1))" local filesize=$(du -h "$output" | cut -f1)
echo -e "${GREEN}✓${NC} $name déjà présent ($filesize)"
return 0 return 0
fi fi
echo "" echo -e "${BLUE}📥${NC} Téléchargement de $name ($size)..."
echo "📥 Téléchargement de $name ($size)..." echo " Destination: $(basename "$output")"
echo " Destination: $output"
echo "" echo ""
wget --progress=bar:force -O "$output" "$url" 2>&1 | tail -f -n +6 # Téléchargement avec progression simple
if wget --show-progress --progress=dot:giga -O "$output" "$url" 2>&1; then
if [ $? -eq 0 ]; then echo ""
echo "✓ $name téléchargé avec succès" echo -e "${GREEN}✓${NC} $name téléchargé avec succès"
return 0
else else
echo "✗ Erreur lors du téléchargement de $name" echo ""
echo -e "${RED}✗${NC} Erreur lors du téléchargement de $name"
rm -f "$output" rm -f "$output"
return 1 return 1
fi fi
} }
# Menu de sélection # Affichage d'accueil
echo "Quels modèles souhaitez-vous télécharger ?" clear
print_header "🎨 GESTIONNAIRE DE MODÈLES SDXL"
echo "Répertoire des modèles: $MODELS_DIR"
echo "Espace disque disponible: $(df -h "$MODELS_DIR" | tail -1 | awk '{print $4}')"
echo "" echo ""
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
clear
print_header "📋 MENU PRINCIPAL"
echo "=== MODÈLES PHOTORÉALISTES ===" echo "=== MODÈLES PHOTORÉALISTES ==="
echo "1) RealVisXL V4.0 (6.9GB) - Portraits ultra-réalistes, peau détaillée" echo ""
echo "2) Juggernaut XL (6.9GB) - Polyvalent, excellent pour tout type d'image" echo "1) RealVisXL V4.0 (6.9GB)"
echo "3) Proteus XL (6.9GB) - Photoréalisme amélioré, excellente qualité" echo " Portraits ultra-réalistes, peau détaillée"
echo ""
echo "2) Juggernaut XL v9 (6.9GB)"
echo " Polyvalent, excellent pour tout type d'image"
echo ""
echo "3) Proteus V0.4 (6.9GB)"
echo " Photoréalisme amélioré, excellente qualité"
echo "" echo ""
echo "=== MODÈLES ART/STYLISÉS ===" echo "=== MODÈLES ART/STYLISÉS ==="
echo "4) DreamShaper XL (6.9GB) - Art fantastique, peinture, illustration" echo ""
echo "5) SDXL Base 1.0 (6.9GB) - Modèle de base (déjà installé)" echo "4) DreamShaper XL 1.0 (6.9GB)"
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 ""
echo "=== MODÈLES RAPIDES ===" echo "=== MODÈLES RAPIDES ==="
echo "6) SDXL Lightning (6.9GB) - Génération 4x plus rapide, qualité légèrement inférieure"
echo "" echo ""
echo "=== VAE (Optionnel mais recommandé) ===" echo "6) SDXL Lightning 8-step (6.9GB)"
echo "7) SDXL VAE (335MB) - Meilleure qualité de couleurs et détails" echo " Génération 4x plus rapide, 8 étapes seulement"
echo "" echo ""
echo "=== INSTALLATION COMPLETE ===" echo "=== COMPOSANTS ==="
echo "8) Tout télécharger (⚠️ 35GB) - Tous les modèles ci-dessus"
echo "" echo ""
echo "0) Annuler" echo "7) SDXL VAE (335MB)"
echo " Meilleure qualité de couleurs pour tous les modèles"
echo "" 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)
echo "" 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 ""
echo "💡 Conseil : Excellent pour les portraits et photos réalistes" echo -e "${YELLOW}💡 Conseil d'utilisation:${NC}"
echo " Prompt tip: 'professional photo, 8k uhd, dslr, soft lighting'" echo " • Parfait pour les portraits"
echo " • Prompt: 'professional photo, 8k uhd, dslr, soft lighting'"
echo " • Étapes: 40-50, CFG: 7-8"
;; ;;
2) 2)
echo "" 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-v9/resolve/main/Juggernaut-XL-v9.safetensors" \
"$MODELS_DIR/Juggernaut-XL-v9.safetensors" \ "$MODELS_DIR/Juggernaut-XL-v9.safetensors" \
"Juggernaut XL v9" \ "Juggernaut XL v9" \
"6.9GB" "6.9GB"
echo "" echo ""
echo "💡 Conseil : Très polyvalent, bon compromis qualité/vitesse" echo -e "${YELLOW}💡 Conseil d'utilisation:${NC}"
echo " Prompt tip: Fonctionne bien avec tous les styles" echo " • Modèle polyvalent quotidien"
echo " • Fonctionne avec tous les styles"
echo " • Étapes: 30-40, CFG: 7-8"
;; ;;
3) 3)
echo "" clear
print_header "📥 TÉLÉCHARGEMENT: Proteus V0.4"
download_model \ download_model \
"https://huggingface.co/dathudehenry/ProteusV0.4/resolve/main/ProteusV0.4.safetensors" \ "https://huggingface.co/dathudehenry/ProteusV0.4/resolve/main/ProteusV0.4.safetensors" \
"$MODELS_DIR/ProteusV0.4.safetensors" \ "$MODELS_DIR/ProteusV0.4.safetensors" \
"Proteus V0.4" \ "Proteus V0.4" \
"6.9GB" "6.9GB"
echo "" echo ""
echo "💡 Conseil : Alternative à RealVisXL, excellent pour la peau" echo -e "${YELLOW}💡 Conseil d'utilisation:${NC}"
echo " Prompt tip: 'raw photo, realistic, detailed skin texture'" echo " • Excellente texture de peau"
echo " • Prompt: 'raw photo, realistic, detailed skin texture'"
echo " • Étapes: 30-40, CFG: 6-7"
;; ;;
4) 4)
echo "" 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 ""
echo "💡 Conseil : Parfait pour l'art, la fantasy et les illustrations" echo -e "${YELLOW}💡 Conseil d'utilisation:${NC}"
echo " Prompt tip: 'digital art, concept art, highly detailed, fantasy'" echo " • Art, fantasy, illustrations"
echo " • Prompt: 'digital art, concept art, highly detailed'"
echo " • Étapes: 30-40, CFG: 7-8"
;; ;;
5) 5)
echo "" 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 ""
echo "💡 Conseil : Modèle de base Stability AI, très stable" 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)
echo "" clear
print_header "📥 TÉLÉCHARGEMENT: SDXL Lightning"
download_model \ download_model \
"https://huggingface.co/ByteDance/SDXL-Lightning/resolve/main/sdxl_lightning_8step.safetensors" \ "https://huggingface.co/ByteDance/SDXL-Lightning/resolve/main/sdxl_lightning_8step.safetensors" \
"$MODELS_DIR/sdxl_lightning_8step.safetensors" \ "$MODELS_DIR/sdxl_lightning_8step.safetensors" \
"SDXL Lightning 8-step" \ "SDXL Lightning 8-step" \
"6.9GB" "6.9GB"
echo "" echo ""
echo "💡 Conseil : Utilise seulement 8 étapes (au lieu de 30-40)" echo -e "${YELLOW}⚠️ IMPORTANT - Réglages spéciaux:${NC}"
echo " ⚠️ Configurez 'steps: 8' dans OpenWebUI pour ce modèle" echo " • Étapes: 8 (OBLIGATOIRE)"
echo " Parfait pour les tests rapides !" echo " • CFG: 1-2 (TRÈS BAS)"
echo " • 4x plus rapide que les autres modèles"
;; ;;
7) 7)
echo "" 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 ""
echo "💡 Conseil : Utilisez ce VAE avec tous les modèles SDXL pour de meilleures couleurs" 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 ""
echo "⚠️ Cela va télécharger ~35GB de modèles" read -p "Êtes-vous sûr ? (tapez 'oui' pour confirmer): " confirm
read -p "Êtes-vous sûr ? (oui/non): " confirm
if [ "$confirm" = "oui" ]; then if [ "$confirm" = "oui" ]; then
echo ""
echo "Démarrage du téléchargement de tous les modèles..."
echo ""
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 ""
download_model \ download_model \
"https://huggingface.co/RunDiffusion/Juggernaut-XL-v9/resolve/main/Juggernaut-XL-v9.safetensors" \ "https://huggingface.co/RunDiffusion/Juggernaut-XL-v9/resolve/main/Juggernaut-XL-v9.safetensors" \
"$MODELS_DIR/Juggernaut-XL-v9.safetensors" \ "$MODELS_DIR/Juggernaut-XL-v9.safetensors" \
"Juggernaut XL v9" \ "Juggernaut XL v9" \
"6.9GB" "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 \ 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 ""
download_model \ download_model \
"https://huggingface.co/ByteDance/SDXL-Lightning/resolve/main/sdxl_lightning_8step.safetensors" \ "https://huggingface.co/ByteDance/SDXL-Lightning/resolve/main/sdxl_lightning_8step.safetensors" \
"$MODELS_DIR/sdxl_lightning_8step.safetensors" \ "$MODELS_DIR/sdxl_lightning_8step.safetensors" \
"SDXL Lightning 8-step" \ "SDXL Lightning 8-step" \
"6.9GB" "6.9GB"
echo ""
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" \
@@ -182,30 +266,51 @@ case $choice in
"SDXL VAE" \ "SDXL VAE" \
"335MB" "335MB"
echo "" clear
echo "✅ Tous les modèles ont été téléchargés !" print_header "✅ TOUS LES MODÈLES SONT TÉLÉCHARGÉS"
else else
echo ""
echo "Annulation..." echo "Annulation..."
exit 0
fi fi
;; ;;
0) 0)
echo "Annulation..." echo ""
echo "Au revoir !"
exit 0 exit 0
;; ;;
*) *)
echo "Choix invalide" echo ""
echo -e "${RED}✗${NC} Choix invalide"
exit 1 exit 1
;; ;;
esac esac
# Récapitulatif final
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 "==========================================" echo "📊 VAE installés:"
echo "✅ Téléchargement terminé !" ls -lh "$VAE_DIR"/*.safetensors 2>/dev/null | awk '{print " • " $9 " (" $5 ")"}' || echo " (aucun)"
echo "" echo ""
echo "Prochaines étapes :" echo -e "${GREEN}🚀 Prochaines étapes:${NC}"
echo " 1. Redémarrer ComfyUI : sudo docker restart comfyui"
echo " 2. Choisir le modèle dans OpenWebUI (Admin → Settings → Images)"
echo " 3. Consulter docs/MODELS.md pour les réglages optimaux"
echo "" echo ""
echo "Espace disque utilisé :" echo "1. Redémarrer ComfyUI:"
du -sh "$MODELS_DIR" "$VAE_DIR" 2>/dev/null | head -2 echo " sudo docker restart comfyui"
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 "========================================"