Upload 2 files
Browse files
scripts/ComfyUI/Install-ComfyUI.ps1
CHANGED
@@ -217,50 +217,46 @@ Write-Log " - Installing ComfyUI requirements..."
|
|
217 |
Invoke-AndLog "$venvPython" "-m pip install -r `"$comfyPath\requirements.txt`""
|
218 |
|
219 |
# --- Étape 5: Installation des Custom Nodes ---
|
220 |
-
Write-Log "`nStep 5: Installing custom nodes..." -Color Yellow
|
221 |
-
|
222 |
-
|
223 |
-
$
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
if ($node.HasRequirements) {
|
259 |
-
$requirementsFile = if ($node.RequirementsFile) { $node.RequirementsFile } else { "requirements.txt" }
|
260 |
-
$reqPath = Join-Path $nodePath $requirementsFile
|
261 |
-
if (Test-Path $reqPath) { Invoke-AndLog "$venvPython" "-m pip install -r `"$reqPath`"" }
|
262 |
}
|
263 |
-
}
|
264 |
}
|
265 |
|
266 |
# --- Étape 6: Installation des modules Python supplémentaires ---
|
@@ -270,19 +266,6 @@ Write-Log "`nStep 6: Installing supplementary modules..." -Color Yellow
|
|
270 |
Write-Log " - Installing Visual Studio Build Tools..."
|
271 |
winget install --id Microsoft.VisualStudio.2022.BuildTools -e --source winget --override "--quiet --wait --norestart --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.20348"
|
272 |
|
273 |
-
# Python include/libs
|
274 |
-
Write-Log " - Installing Python include/libs for compatibility..."
|
275 |
-
$pyLibsUrl = "https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/others/python_3.12.9_include_libs.zip"
|
276 |
-
$zipPath = Join-Path $InstallPath "python_libs.tmp.zip"
|
277 |
-
$extractPath = Join-Path $comfyPath "venv" # On extrait dans le venv
|
278 |
-
Download-File -Uri $pyLibsUrl -OutFile $zipPath
|
279 |
-
if (Test-Path $zipPath) {
|
280 |
-
try {
|
281 |
-
Expand-Archive -Path $zipPath -DestinationPath $extractPath -Force
|
282 |
-
Write-Log " - Python libs extracted successfully." -Color Green
|
283 |
-
} catch { Write-Log " - FAILED to extract python libs. Error: $($_.Exception.Message)" -Color Red } finally { Remove-Item -Path $zipPath -Force }
|
284 |
-
}
|
285 |
-
|
286 |
# Triton
|
287 |
Write-Log " - Installing Triton..."
|
288 |
$tritonWheel = Join-Path $InstallPath "triton-3.3.0-py3-none-any.whl"
|
|
|
217 |
Invoke-AndLog "$venvPython" "-m pip install -r `"$comfyPath\requirements.txt`""
|
218 |
|
219 |
# --- Étape 5: Installation des Custom Nodes ---
|
220 |
+
Write-Log "`nStep 5: Installing custom nodes from CSV list..." -Color Yellow
|
221 |
+
|
222 |
+
$csvUrl = "https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/scripts/Nodes_installer/custom_nodes.csv"
|
223 |
+
$scriptsFolder = Join-Path $InstallPath "scripts"
|
224 |
+
$csvPath = Join-Path $scriptsFolder "custom_nodes.csv"
|
225 |
+
|
226 |
+
# Télécharge la dernière liste de custom nodes
|
227 |
+
Download-File -Uri $csvUrl -OutFile $csvPath
|
228 |
+
|
229 |
+
if (-not (Test-Path $csvPath)) {
|
230 |
+
Write-Log " - ERREUR: Impossible de télécharger la liste des custom nodes. Étape ignorée." -Color Red
|
231 |
+
} else {
|
232 |
+
$customNodes = Import-Csv -Path $csvPath
|
233 |
+
$customNodesPath = Join-Path $comfyPath "custom_nodes"
|
234 |
+
|
235 |
+
foreach ($node in $customNodes) {
|
236 |
+
$nodeName = $node.Name
|
237 |
+
$repoUrl = $node.RepoUrl
|
238 |
+
|
239 |
+
# Détermine le chemin d'installation final
|
240 |
+
$nodePath = if ($node.Subfolder) { Join-Path $customNodesPath $node.Subfolder } else { Join-Path $customNodesPath $nodeName }
|
241 |
+
|
242 |
+
if (-not (Test-Path $nodePath)) {
|
243 |
+
Write-Log " - Installing $nodeName..."
|
244 |
+
|
245 |
+
# Gère le cas spécial du subpack
|
246 |
+
$cloneTargetPath = if ($node.Subfolder) { (Split-Path $nodePath -Parent) } else { $nodePath }
|
247 |
+
if ($nodeName -eq 'ComfyUI-Impact-Subpack') { $clonePath = Join-Path $cloneTargetPath "impact_subpack" } else { $clonePath = $cloneTargetPath }
|
248 |
+
|
249 |
+
Invoke-AndLog "git" "clone $repoUrl `"$clonePath`""
|
250 |
+
|
251 |
+
# Installe les dépendances si un fichier est spécifié
|
252 |
+
if ($node.RequirementsFile) {
|
253 |
+
$reqPath = Join-Path $nodePath $node.RequirementsFile
|
254 |
+
if (Test-Path $reqPath) { Invoke-AndLog "$venvPython" "-m pip install -r `"$reqPath`"" }
|
255 |
+
}
|
256 |
+
} else {
|
257 |
+
Write-Log " - $nodeName (already exists, skipping)" -Color Green
|
|
|
|
|
|
|
|
|
258 |
}
|
259 |
+
}
|
260 |
}
|
261 |
|
262 |
# --- Étape 6: Installation des modules Python supplémentaires ---
|
|
|
266 |
Write-Log " - Installing Visual Studio Build Tools..."
|
267 |
winget install --id Microsoft.VisualStudio.2022.BuildTools -e --source winget --override "--quiet --wait --norestart --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.20348"
|
268 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
# Triton
|
270 |
Write-Log " - Installing Triton..."
|
271 |
$tritonWheel = Join-Path $InstallPath "triton-3.3.0-py3-none-any.whl"
|
scripts/ComfyUI/Update-ComfyUI.ps1
CHANGED
@@ -78,16 +78,54 @@ Write-Log "=====================================================================
|
|
78 |
Write-Log "`n[1/4] Updating ComfyUI Core..." -Color Green
|
79 |
Invoke-Git-Pull -DirectoryPath $comfyPath
|
80 |
|
81 |
-
# --- 2. Update Custom Nodes ---
|
82 |
-
Write-Log "`n[2/4] Updating Custom Nodes..." -Color Green
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
}
|
89 |
-
} else {
|
90 |
-
Write-Log " - Custom nodes directory not found, skipping."
|
91 |
}
|
92 |
|
93 |
|
|
|
78 |
Write-Log "`n[1/4] Updating ComfyUI Core..." -Color Green
|
79 |
Invoke-Git-Pull -DirectoryPath $comfyPath
|
80 |
|
81 |
+
# --- 2. Update and Install Custom Nodes ---
|
82 |
+
Write-Log "`n[2/4] Updating and Installing Custom Nodes..." -Color Green
|
83 |
+
|
84 |
+
$csvUrl = "https://huggingface.co/UmeAiRT/ComfyUI-Auto_installer/resolve/main/scripts/Nodes_installer/custom_nodes.csv"
|
85 |
+
$scriptsFolder = Join-Path $InstallPath "scripts"
|
86 |
+
$csvPath = Join-Path $scriptsFolder "custom_nodes.csv"
|
87 |
+
|
88 |
+
# Télécharge la dernière liste de custom nodes
|
89 |
+
try {
|
90 |
+
Invoke-WebRequest -Uri $csvUrl -OutFile $csvPath
|
91 |
+
} catch {
|
92 |
+
Write-Log " - ERREUR: Impossible de télécharger la liste des custom nodes. Mise à jour des nodes ignorée." -Color Red
|
93 |
+
return
|
94 |
+
}
|
95 |
+
|
96 |
+
$customNodesList = Import-Csv -Path $csvPath
|
97 |
+
$existingNodeDirs = Get-ChildItem -Path $customNodesPath -Directory
|
98 |
+
|
99 |
+
# D'abord, on met à jour les nodes existants
|
100 |
+
Write-Log " - Updating existing nodes..."
|
101 |
+
foreach ($dir in $existingNodeDirs) {
|
102 |
+
Write-Log " - Checking node: $($dir.Name)"
|
103 |
+
Invoke-Git-Pull -DirectoryPath $dir.FullName
|
104 |
+
}
|
105 |
+
|
106 |
+
# Ensuite, on vérifie s'il y a de nouveaux nodes à installer
|
107 |
+
Write-Log " - Checking for new nodes to install..."
|
108 |
+
foreach ($node in $customNodesList) {
|
109 |
+
$nodeName = $node.Name
|
110 |
+
$nodePath = if ($node.Subfolder) { Join-Path $customNodesPath $node.Subfolder } else { Join-Path $customNodesPath $nodeName }
|
111 |
+
|
112 |
+
if (-not (Test-Path $nodePath)) {
|
113 |
+
Write-Log " - New node found: $nodeName. Installing..." -Color Yellow
|
114 |
+
|
115 |
+
$repoUrl = $node.RepoUrl
|
116 |
+
$cloneTargetPath = if ($node.Subfolder) { (Split-Path $nodePath -Parent) } else { $nodePath }
|
117 |
+
if ($nodeName -eq 'ComfyUI-Impact-Subpack') { $clonePath = Join-Path $cloneTargetPath "impact_subpack" } else { $clonePath = $cloneTargetPath }
|
118 |
+
|
119 |
+
$tempLogFile = Join-Path $env:TEMP ([System.Guid]::NewGuid().ToString() + ".tmp")
|
120 |
+
try {
|
121 |
+
$commandToRun = "git clone $repoUrl `"$clonePath`""
|
122 |
+
$cmdArguments = "/C `"$commandToRun > `"`"$tempLogFile`"`" 2>&1`""
|
123 |
+
Start-Process -FilePath "cmd.exe" -ArgumentList $cmdArguments -Wait -WindowStyle Hidden
|
124 |
+
if (Test-Path $tempLogFile) { Add-Content -Path $logFile -Value (Get-Content $tempLogFile) }
|
125 |
+
} finally {
|
126 |
+
if (Test-Path $tempLogFile) { Remove-Item $tempLogFile }
|
127 |
+
}
|
128 |
}
|
|
|
|
|
129 |
}
|
130 |
|
131 |
|