Upload 4 files
Browse files
scripts/Model_downloader/Download-FLUX-Models.ps1
CHANGED
@@ -15,6 +15,7 @@ param(
|
|
15 |
#===========================================================================
|
16 |
# SECTION 1: HELPER FUNCTIONS & SETUP
|
17 |
#===========================================================================
|
|
|
18 |
function Write-Log {
|
19 |
param([string]$Message, [string]$Color = "White")
|
20 |
# Utilise $InstallPath (passé en argument) pour trouver le bon dossier de logs
|
|
|
15 |
#===========================================================================
|
16 |
# SECTION 1: HELPER FUNCTIONS & SETUP
|
17 |
#===========================================================================
|
18 |
+
$InstallPath = $InstallPath.Trim('"')
|
19 |
function Write-Log {
|
20 |
param([string]$Message, [string]$Color = "White")
|
21 |
# Utilise $InstallPath (passé en argument) pour trouver le bon dossier de logs
|
scripts/Model_downloader/Download-HIDREAM-Models.ps1
CHANGED
@@ -12,6 +12,7 @@ param(
|
|
12 |
#===========================================================================
|
13 |
# SECTION 1: HELPER FUNCTIONS & SETUP
|
14 |
#===========================================================================
|
|
|
15 |
function Write-Log { param([string]$Message, [string]$Color = "White") { $logFile = Join-Path $InstallPath "logs\install_log.txt"; $formattedMessage = "[$([DateTime]::Now.ToString('yyyy-MM-dd HH:mm:ss'))] [ModelDownloader-HiDream] $Message"; Write-Host $Message -ForegroundColor $Color; Add-Content -Path $logFile -Value $formattedMessage -ErrorAction SilentlyContinue; } }
|
16 |
function Invoke-AndLog { param([string]$File, [string]$Arguments) { $logFile = Join-Path $InstallPath "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 } } }
|
17 |
function Download-File { param([string]$Uri, [string]$OutFile) { if (Test-Path $OutFile) { Write-Log "Skipping: $((Split-Path $OutFile -Leaf)) (already exists)." -Color Gray } else { $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 } } } }
|
|
|
12 |
#===========================================================================
|
13 |
# SECTION 1: HELPER FUNCTIONS & SETUP
|
14 |
#===========================================================================
|
15 |
+
$InstallPath = $InstallPath.Trim('"')
|
16 |
function Write-Log { param([string]$Message, [string]$Color = "White") { $logFile = Join-Path $InstallPath "logs\install_log.txt"; $formattedMessage = "[$([DateTime]::Now.ToString('yyyy-MM-dd HH:mm:ss'))] [ModelDownloader-HiDream] $Message"; Write-Host $Message -ForegroundColor $Color; Add-Content -Path $logFile -Value $formattedMessage -ErrorAction SilentlyContinue; } }
|
17 |
function Invoke-AndLog { param([string]$File, [string]$Arguments) { $logFile = Join-Path $InstallPath "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 } } }
|
18 |
function Download-File { param([string]$Uri, [string]$OutFile) { if (Test-Path $OutFile) { Write-Log "Skipping: $((Split-Path $OutFile -Leaf)) (already exists)." -Color Gray } else { $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 } } } }
|
scripts/Model_downloader/Download-LTXV-Models.ps1
CHANGED
@@ -12,6 +12,7 @@ param(
|
|
12 |
#===========================================================================
|
13 |
# SECTION 1: HELPER FUNCTIONS & SETUP
|
14 |
#===========================================================================
|
|
|
15 |
function Write-Log { param([string]$Message, [string]$Color = "White") { $logFile = Join-Path $InstallPath "logs\install_log.txt"; $formattedMessage = "[$([DateTime]::Now.ToString('yyyy-MM-dd HH:mm:ss'))] [ModelDownloader-LTXV] $Message"; Write-Host $Message -ForegroundColor $Color; Add-Content -Path $logFile -Value $formattedMessage -ErrorAction SilentlyContinue; } }
|
16 |
function Invoke-AndLog { param([string]$File, [string]$Arguments) { $logFile = Join-Path $InstallPath "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 } } }
|
17 |
function Download-File { param([string]$Uri, [string]$OutFile) { if (Test-Path $OutFile) { Write-Log "Skipping: $((Split-Path $OutFile -Leaf)) (already exists)." -Color Gray } else { $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 } } } }
|
|
|
12 |
#===========================================================================
|
13 |
# SECTION 1: HELPER FUNCTIONS & SETUP
|
14 |
#===========================================================================
|
15 |
+
$InstallPath = $InstallPath.Trim('"')
|
16 |
function Write-Log { param([string]$Message, [string]$Color = "White") { $logFile = Join-Path $InstallPath "logs\install_log.txt"; $formattedMessage = "[$([DateTime]::Now.ToString('yyyy-MM-dd HH:mm:ss'))] [ModelDownloader-LTXV] $Message"; Write-Host $Message -ForegroundColor $Color; Add-Content -Path $logFile -Value $formattedMessage -ErrorAction SilentlyContinue; } }
|
17 |
function Invoke-AndLog { param([string]$File, [string]$Arguments) { $logFile = Join-Path $InstallPath "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 } } }
|
18 |
function Download-File { param([string]$Uri, [string]$OutFile) { if (Test-Path $OutFile) { Write-Log "Skipping: $((Split-Path $OutFile -Leaf)) (already exists)." -Color Gray } else { $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 } } } }
|
scripts/Model_downloader/Download-WAN-Models.ps1
CHANGED
@@ -12,6 +12,7 @@ param(
|
|
12 |
#===========================================================================
|
13 |
# SECTION 1: HELPER FUNCTIONS & SETUP
|
14 |
#===========================================================================
|
|
|
15 |
function Write-Log {
|
16 |
param([string]$Message, [string]$Color = "White")
|
17 |
$logFile = Join-Path $InstallPath "logs\install_log.txt"
|
|
|
12 |
#===========================================================================
|
13 |
# SECTION 1: HELPER FUNCTIONS & SETUP
|
14 |
#===========================================================================
|
15 |
+
$InstallPath = $InstallPath.Trim('"')
|
16 |
function Write-Log {
|
17 |
param([string]$Message, [string]$Color = "White")
|
18 |
$logFile = Join-Path $InstallPath "logs\install_log.txt"
|