Run this model with HF Jobs
Run UmeAiRT/ComfyUI-Auto-Installer-Assets on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/UmeAiRT/ComfyUI-Auto-Installer-Assets. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/UmeAiRT/ComfyUI-Auto-Installer-Assets on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use UmeAiRT/ComfyUI-Auto-Installer-Assets with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use UmeAiRT/ComfyUI-Auto-Installer-Assets with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("UmeAiRT/ComfyUI-Auto-Installer-Assets", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Upload Download-FLUX-Models.ps1
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256<#
.SYNOPSIS
A PowerShell script to interactively download FLUX models for ComfyUI.
.DESCRIPTION
This script replaces the UmeAiRT-Model_downloader-FLUX-Auto.bat file.
It provides a series of prompts to the user to select which specific FLUX models
they wish to download, then downloads them using the provided helper functions.
#>
#===========================================================================
# SECTION 1: HELPER FUNCTIONS & SETUP
#===========================================================================
# --- Helper function to write to console and log file ---
function Write-Log {
param([string]$Message, [string]$Color = "White")
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
# Note: Log file path assumes it's run from the main installer's directory
$logFile = Join-Path $PSScriptRoot "logs\install_log.txt"
$formattedMessage = "[$timestamp] [ModelDownloader] $Message"
Write-Host $Message -ForegroundColor $Color
Add-Content -Path $logFile -Value $formattedMessage
}
# --- Helper function to execute a command and log its output ---
function Invoke-AndLog {
param([string]$File, [string]$Arguments)
$logFile = Join-Path $PSScriptRoot "logs\install_log.txt"
$commandToRun = "`"$File`" $Arguments"
$cmdArguments = "/C `"$commandToRun >> `"`"$logFile`"`" 2>&1`""
try {
Start-Process -FilePath "cmd.exe" -ArgumentList $cmdArguments -Wait -WindowStyle Hidden
} catch {
Write-Log "FATAL ERROR trying to execute command: $commandToRun" -Color Red
}
}
# --- Smart Download Function ---
function Download-File {
param(
[string]$Uri,
[string]$OutFile
)
# Vérifie si le fichier de destination existe déjà
if (Test-Path $OutFile) {
Write-Log "Skipping: $((Split-Path $OutFile -Leaf)) (already exists)." -Color Gray
} else {
# Si le fichier n'existe pas, on procède au téléchargement
$fileName = Split-Path -Path $Uri -Leaf
if (Get-Command 'aria2c' -ErrorAction SilentlyContinue) {
Write-Log "Downloading: $fileName"
$aria_args = "-c -x 16 -s 16 -k 1M --dir=`"$((Split-Path $OutFile -Parent))`" --out=`"$((Split-Path $OutFile -Leaf))`" `"$Uri`""
Invoke-AndLog "aria2c" $aria_args
} else {
Write-Log "Aria2 not found. Falling back to standard download: $fileName" -Color Yellow
Invoke-WebRequest -Uri $Uri -OutFile $OutFile
}
}
}
# --- Function to ask a multiple choice question ---
function Ask-Question {
param(
[string]$Prompt,
[string[]]$Choices,
[string[]]$ValidAnswers
)
$choice = ''
while ($choice -notin $ValidAnswers) {
Write-Log "`n$Prompt" -Color Yellow
foreach ($line in $Choices) {
Write-Host " $line" -ForegroundColor Green
}
$choice = (Read-Host "Enter your choice and press Enter").ToUpper()
if ($choice -notin $ValidAnswers) {
Write-Log "Invalid choice. Please try again." -Color Red
}
}
return $choice
}
#===========================================================================
# SECTION 2: SCRIPT EXECUTION
#===========================================================================
# --- Path Detection ---
$installPath = $PSScriptRoot
$basePath = Join-Path $installPath "ComfyUI_windows_portable"
if (-not (Test-Path $basePath)) {
$basePath = $installPath
}
$modelsPath = Join-Path $basePath "ComfyUI\models"
if (-not (Test-Path $modelsPath)) {
Write-Log "Could not find ComfyUI models path. Exiting." -Color Red
Read-Host "Press Enter to exit."
exit
}
# --- NOUVEAU : Détection du GPU avant les questions ---
Write-Log "-------------------------------------------------------------------------------"
Write-Log "Checking for NVIDIA GPU to provide model recommendations..." -Color Yellow
if (Get-Command 'nvidia-smi' -ErrorAction SilentlyContinue) {
try {
$gpuInfoCsv = nvidia-smi --query-gpu=name,memory.total --format=csv,noheader
if ($gpuInfoCsv) {
$gpuInfoParts = $gpuInfoCsv.Split(',')
$gpuName = $gpuInfoParts[0].Trim()
$gpuMemoryMiB = ($gpuInfoParts[1] -replace ' MiB').Trim()
$gpuMemoryGiB = [math]::Round([int]$gpuMemoryMiB / 1024)
Write-Log "GPU : $gpuName" -Color Green
Write-Log "VRAM : $gpuMemoryGiB GB" -Color Green
if ($gpuMemoryGiB -ge 30) {
Write-Log "Recommandation: fp16" -Color Cyan
} elseif ($gpuMemoryGiB -ge 18) {
Write-Log "Recommandation: fp8 or GGUF Q8" -Color Cyan
} elseif ($gpuMemoryGiB -ge 14) {
Write-Log "Recommandation: GGUF Q6" -Color Cyan
}elseif ($gpuMemoryGiB -ge 12) {
Write-Log "Recommandation: GGUF Q5" -Color Cyan
}elseif ($gpuMemoryGiB -ge 10) {
Write-Log "Recommandation: GGUF Q4" -Color Cyan
}elseif ($gpuMemoryGiB -ge 8) {
Write-Log "Recommandation: GGUF Q3" -Color Cyan
}else {
Write-Log "Recommandation: GGUF Q2" -Color Cyan
}
}
} catch {
Write-Log "Impossible de récupérer les informations GPU. Erreur: $($_.Exception.Message)" -Color Red
}
} else {
Write-Log "Aucun GPU NVIDIA detecte (nvidia-smi introuvable). Choisissez selon votre matériel." -Color Gray
}
Write-Log "-------------------------------------------------------------------------------"
# --- Ask all questions first ---
$fluxChoice = Ask-Question -Prompt "Do you want to download FLUX base models?" -Choices @("A) fp16", "B) fp8", "C) All", "D) No") -ValidAnswers @("A", "B", "C", "D")
$ggufChoice = Ask-Question -Prompt "Do you want to download FLUX GGUF models?" -Choices @("A) Q8 (18GB VRAM)","B) Q6 (14GB VRAM)", "C) Q5 (12GB VRAM)", "D) Q4 (10GB VRAM)", "E) Q3 (8GB VRAM)", "F) Q2 (6GB VRAM)", "G) All", "H) No") -ValidAnswers @("A", "B", "C", "D", "E", "F", "G", "H")
$schnellChoice = Ask-Question -Prompt "Do you want to download the FLUX SCHNELL Model?" -Choices @("A) Yes", "B) No") -ValidAnswers @("A", "B")
$controlnetChoice = Ask-Question -Prompt "Do you want to download FLUX ControlNet Models?" -Choices @("A) fp16", "B) fp8", "C) Q8", "D) Q5", "E) Q4", "F) All", "G) No") -ValidAnswers @("A", "B", "C", "D", "E", "F", "G")
$pulidChoice = Ask-Question -Prompt "Do you want to download FLUX PuLID and REDUX Models?" -Choices @("A) Yes", "B) No") -ValidAnswers @("A", "B")
$loraChoice = Ask-Question -Prompt "Do you want to download UmeAiRT LoRAs?" -Choices @("A) Yes", "B) No") -ValidAnswers @("A", "B")
# --- Download files based on answers ---
$baseUrl = "https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/models"
# FLUX Base Models
if ($fluxChoice -in @("A", "C")) {
$destDir = Join-Path $modelsPath "diffusion_models\FLUX"; New-Item -Path $destDir -ItemType Directory -Force | Out-Null
$clipDir = Join-Path $modelsPath "clip"; New-Item -Path $clipDir -ItemType Directory -Force | Out-Null
Download-File -Uri "$baseUrl/diffusion_models/FLUX/flux1-dev-fp16.safetensors" -OutFile (Join-Path $destDir "flux1-dev-fp16.safetensors")
Download-File -Uri "$baseUrl/clip/t5xxl_fp16.safetensors" -OutFile (Join-Path $clipDir "t5xxl_fp16.safetensors")
}
if ($fluxChoice -in @("B", "C")) {
$destDir = Join-Path $modelsPath "diffusion_models\FLUX"; New-Item -Path $destDir -ItemType Directory -Force | Out-Null
$clipDir = Join-Path $modelsPath "clip"; New-Item -Path $clipDir -ItemType Directory -Force | Out-Null
Download-File -Uri "$baseUrl/diffusion_models/FLUX/flux1-dev-fp8.safetensors" -OutFile (Join-Path $destDir "flux1-dev-fp8.safetensors")
Download-File -Uri "$baseUrl/clip/t5xxl_fp8_e4m3fn.safetensors" -OutFile (Join-Path $clipDir "t5xxl_fp8_e4m3fn.safetensors")
}
# Common files (VAE, CLIPs) - Downloaded if any main option was chosen
$destDir = Join-Path $modelsPath "vae"; New-Item -Path $destDir -ItemType Directory -Force | Out-Null
Download-File -Uri "$baseUrl/vae/ae.safetensors" -OutFile (Join-Path $destDir "ae.safetensors")
$destDir = Join-Path $modelsPath "clip"; New-Item -Path $destDir -ItemType Directory -Force | Out-Null
Download-File -Uri "$baseUrl/clip/clip_l.safetensors" -OutFile (Join-Path $destDir "clip_l.safetensors")
# GGUF Models
if ($ggufChoice -ne 'H') {
$unetDir = Join-Path $modelsPath "unet\FLUX"; New-Item -Path $unetDir -ItemType Directory -Force | Out-Null
$clipDir = Join-Path $modelsPath "clip"; New-Item -Path $clipDir -ItemType Directory -Force | Out-Null
if ($ggufChoice -in @("A", "G")) {
Download-File -Uri "$baseUrl/clip/t5-v1_1-xxl-encoder-Q8_0.gguf" -OutFile (Join-Path $clipDir "t5-v1_1-xxl-encoder-Q8_0.gguf")
Download-File -Uri "$baseUrl/unet/FLUX/flux1-dev-Q8_0.gguf" -OutFile (Join-Path $unetDir "flux1-dev-Q8_0.gguf")
}
if ($ggufChoice -in @("B", "G")) {
Download-File -Uri "$baseUrl/clip/t5-v1_1-xxl-encoder-Q6_K.gguf" -OutFile (Join-Path $clipDir "t5-v1_1-xxl-encoder-Q6_K.gguf")
Download-File -Uri "$baseUrl/unet/FLUX/flux1-dev-Q6_K.gguf" -OutFile (Join-Path $unetDir "flux1-dev-Q6_K.gguf")
}
if ($ggufChoice -in @("C", "G")) {
Download-File -Uri "$baseUrl/clip/t5-v1_1-xxl-encoder-Q5_K_M.gguf" -OutFile (Join-Path $clipDir "t5-v1_1-xxl-encoder-Q5_K_M.gguf")
Download-File -Uri "$baseUrl/unet/FLUX/flux1-dev-Q5_K_S.gguf" -OutFile (Join-Path $unetDir "flux1-dev-Q5_K_S.gguf")
}
if ($ggufChoice -in @("D", "G")) {
Download-File -Uri "$baseUrl/clip/t5-v1_1-xxl-encoder-Q4_K_S.gguf" -OutFile (Join-Path $clipDir "t5-v1_1-xxl-encoder-Q4_K_S.gguf")
Download-File -Uri "$baseUrl/unet/FLUX/flux1-dev-Q4_K_S.gguf" -OutFile (Join-Path $unetDir "flux1-dev-Q4_K_S.gguf")
}
if ($ggufChoice -in @("E", "G")) {
Download-File -Uri "$baseUrl/clip/t5-v1_1-xxl-encoder-Q3_K_S.gguf" -OutFile (Join-Path $clipDir "t5-v1_1-xxl-encoder-Q3_K_S.gguf")
Download-File -Uri "$baseUrl/unet/FLUX/flux1-dev-Q3_K_S.gguf" -OutFile (Join-Path $unetDir "flux1-dev-Q3_K_S.gguf")
}
if ($ggufChoice -in @("F", "G")) {
Download-File -Uri "$baseUrl/clip/t5-v1_1-xxl-encoder-Q3_K_S.gguf" -OutFile (Join-Path $clipDir "t5-v1_1-xxl-encoder-Q3_K_S.gguf")
Download-File -Uri "$baseUrl/unet/FLUX/flux1-dev-Q2_K.gguf" -OutFile (Join-Path $unetDir "flux1-dev-Q2_K.gguf")
}
}
# Schnell Model
if ($schnellChoice -ne 'G') {
$destDir = Join-Path $modelsPath "diffusion_models\FLUX"; New-Item -Path $destDir -ItemType Directory -Force | Out-Null
Download-File -Uri "$baseUrl/diffusion_models/FLUX/flux1-schnell-fp8.safetensors" -OutFile (Join-Path $destDir "flux1-schnell-fp8.safetensors")
}
# ControlNet Models
if ($controlnetChoice -eq 'A') {
$destDir = Join-Path $modelsPath "xlabs\controlnets"; New-Item -Path $destDir -ItemType Directory -Force | Out-Null
$unetDir = Join-Path $modelsPath "unet\FLUX"; New-Item -Path $unetDir -ItemType Directory -Force | Out-Null
Download-File -Uri "$baseUrl/xlabs/controlnets/flux-canny-controlnet-v3.safetensors" -OutFile (Join-Path $destDir "flux-canny-controlnet-v3.safetensors")
Download-File -Uri "$baseUrl/xlabs/controlnets/flux-depth-controlnet-v3.safetensors" -OutFile (Join-Path $destDir "flux-depth-controlnet-v3.safetensors")
if ($controlnetChoice -in @("A", "F")) {
Download-File -Uri "$baseUrl/diffusion_models/FLUX/flux1-canny-dev-fp16.safetensors" -OutFile (Join-Path $unetDir "flux1-canny-dev-fp16.safetensors")
Download-File -Uri "$baseUrl/diffusion_models/FLUX/flux1-depth-dev-fp16.safetensors" -OutFile (Join-Path $unetDir "flux1-depth-dev-fp16.safetensors")
}
if ($controlnetChoice -in @("B", "F")) {
Download-File -Uri "$baseUrl/diffusion_models/FLUX/flux1-canny-dev-fp8.safetensors" -OutFile (Join-Path $unetDir "flux1-canny-dev-fp8.safetensors")
Download-File -Uri "$baseUrl/diffusion_models/FLUX/flux1-depth-dev-fp8.safetensors" -OutFile (Join-Path $unetDir "flux1-depth-dev-fp8.safetensors")
}
if ($controlnetChoice -in @("C", "F")) {
Download-File -Uri "$baseUrl/unet/FLUX/flux1-canny-dev-fp16-Q8_0-GGUF.gguf" -OutFile (Join-Path $unetDir "flux1-canny-dev-fp16-Q8_0-GGUF.gguf")
Download-File -Uri "$baseUrl/unet/FLUX/flux1-depth-dev-fp16-Q8_0-GGUF.gguf" -OutFile (Join-Path $unetDir "flux1-depth-dev-fp16-Q8_0-GGUF.gguf")
}
if ($controlnetChoice -in @("D", "F")) {
Download-File -Uri "$baseUrl/unet/FLUX/flux1-canny-dev-fp16-Q5_0-GGUF.gguf" -OutFile (Join-Path $unetDir "flux1-canny-dev-fp16-Q5_0-GGUF.gguf")
Download-File -Uri "$baseUrl/unet/FLUX/flux1-depth-dev-fp16-Q5_0-GGUF.gguf" -OutFile (Join-Path $unetDir "flux1-depth-dev-fp16-Q5_0-GGUF.gguf")
}
if ($controlnetChoice -in @("E", "F")) {
Download-File -Uri "$baseUrl/unet/FLUX/flux1-canny-dev-fp16-Q4_0-GGUF.gguf" -OutFile (Join-Path $unetDir "flux1-canny-dev-fp16-Q4_0-GGUF.gguf")
Download-File -Uri "$baseUrl/unet/FLUX/flux1-depth-dev-fp16-Q4_0-GGUF.gguf" -OutFile (Join-Path $unetDir "flux1-depth-dev-fp16-Q4_0-GGUF.gguf")
}
}
# PuLID Models
if ($pulidChoice -eq 'A') {
$destDir = Join-Path $modelsPath "pulid"; New-Item -Path $destDir -ItemType Directory -Force | Out-Null
Download-File -Uri "$baseUrl/pulid/pulid_flux_v0.9.0.safetensors" -OutFile (Join-Path $destDir "pulid_flux_v0.9.0.safetensors")
$destDir = Join-Path $modelsPath "style_models"; New-Item -Path $destDir -ItemType Directory -Force | Out-Null
Download-File -Uri "$baseUrl/style_models/flux1-redux-dev.safetensors" -OutFile (Join-Path $destDir "flux1-redux-dev.safetensors")
}
# LoRA Models
if ($loraChoice -eq 'A') {
$destDir = Join-Path $modelsPath "loras\FLUX"; New-Item -Path $destDir -ItemType Directory -Force | Out-Null
Download-File -Uri "https://huggingface.co/UmeAiRT/FLUX.1-dev-LoRA-Ume_Sky/resolve/main/ume_sky_v2.safetensors" -OutFile (Join-Path $destDir "ume_sky_v2.safetensors")
Download-File -Uri "https://huggingface.co/UmeAiRT/FLUX.1-dev-LoRA-Modern_Pixel_art/resolve/main/ume_modern_pixelart.safetensors" -OutFile (Join-Path $destDir "ume_modern_pixelart.safetensors")
Download-File -Uri "https://huggingface.co/UmeAiRT/FLUX.1-dev-LoRA-Romanticism/resolve/main/ume_classic_Romanticism.safetensors" -OutFile (Join-Path $destDir "ume_classic_Romanticism.safetensors")
Download-File -Uri "https://huggingface.co/UmeAiRT/FLUX.1-dev-LoRA-Impressionism/resolve/main/ume_classic_impressionist.safetensors" -OutFile (Join-Path $destDir "ume_classic_impressionist.safetensors")
}
Write-Log "`nFLUX model downloads complete." -Color Greenscripts/Model_downloader/Download-FLUX-Models.ps1Added+256