UmeAiRT commited on
Commit
bf2ed69
·
verified ·
1 Parent(s): 2fda037

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
- $customNodesPath = Join-Path $InstallPath "custom_nodes" # Définit le chemin pour les noeuds
222
- # ... (La liste des noeuds est inchangée)
223
- $customNodes = @(
224
- @{Name="ComfyUI-Manager"; Repo="https://github.com/ltdrdata/ComfyUI-Manager.git"; HasRequirements=$false},
225
- @{Name="ComfyUI-Impact-Pack"; Repo="https://github.com/ltdrdata/ComfyUI-Impact-Pack"; HasRequirements=$true},
226
- @{Name="ComfyUI-Impact-Subpack"; Repo="https://github.com/ltdrdata/ComfyUI-Impact-Subpack"; Subfolder="ComfyUI-Impact-Pack/impact_subpack"; HasRequirements=$true},
227
- @{Name="ComfyUI-GGUF"; Repo="https://github.com/city96/ComfyUI-GGUF"; HasRequirements=$true},
228
- @{Name="ComfyUI-mxToolkit"; Repo="https://github.com/Smirnov75/ComfyUI-mxToolkit"; HasRequirements=$false},
229
- @{Name="ComfyUI-Custom-Scripts"; Repo="https://github.com/pythongosssss/ComfyUI-Custom-Scripts"; HasRequirements=$false},
230
- @{Name="ComfyUI-KJNodes"; Repo="https://github.com/kijai/ComfyUI-KJNodes"; HasRequirements=$true},
231
- @{Name="ComfyUI-WanVideoWrapper"; Repo="https://github.com/kijai/ComfyUI-WanVideoWrapper"; HasRequirements=$true},
232
- @{Name="ComfyUI-VideoHelperSuite"; Repo="https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite"; HasRequirements=$true},
233
- @{Name="ComfyUI-Frame-Interpolation"; Repo="https://github.com/Fannovel16/ComfyUI-Frame-Interpolation"; RequirementsFile="requirements-with-cupy.txt"; HasRequirements=$true},
234
- @{Name="rgthree-comfy"; Repo="https://github.com/rgthree/rgthree-comfy"; HasRequirements=$true},
235
- @{Name="ComfyUI-Easy-Use"; Repo="https://github.com/yolain/ComfyUI-Easy-Use"; HasRequirements=$true},
236
- @{Name="ComfyUI_PuLID_Flux_ll"; Repo="https://github.com/lldacing/ComfyUI_PuLID_Flux_ll"; HasRequirements=$true},
237
- @{Name="ComfyUI-HunyuanVideoMultiLora"; Repo="https://github.com/facok/ComfyUI-HunyuanVideoMultiLora"; HasRequirements=$false},
238
- @{Name="was-node-suite-comfyui"; Repo="https://github.com/WASasquatch/was-node-suite-comfyui"; HasRequirements=$true},
239
- @{Name="ComfyUI-Florence2"; Repo="https://github.com/kijai/ComfyUI-Florence2"; HasRequirements=$true},
240
- @{Name="ComfyUI-MultiGPU"; Repo="https://github.com/pollockjj/ComfyUI-MultiGPU"; HasRequirements=$false},
241
- @{Name="ComfyUI-WanStartEndFramesNative"; Repo="https://github.com/Flow-two/ComfyUI-WanStartEndFramesNative"; HasRequirements=$false},
242
- @{Name="ComfyUI-Image-Saver"; Repo="https://github.com/alexopus/ComfyUI-Image-Saver"; HasRequirements=$true},
243
- @{Name="ComfyUI_UltimateSDUpscale"; Repo="https://github.com/ssitu/ComfyUI_UltimateSDUpscale"; HasRequirements=$false},
244
- @{Name="comfyui_controlnet_aux"; Repo="https://github.com/Fannovel16/comfyui_controlnet_aux"; HasRequirements=$true},
245
- @{Name="x-flux-comfyui"; Repo="https://github.com/XLabs-AI/x-flux-comfyui"; HasRequirements=$true},
246
- @{Name="ComfyUI-RMBG"; Repo="https://github.com/1038lab/ComfyUI-RMBG"; HasRequirements=$true},
247
- @{Name="ComfyUI-Detail-Daemon"; Repo="https://github.com/Jonseed/ComfyUI-Detail-Daemon"; HasRequirements=$true},
248
- @{Name="ComfyUI-TeaCache"; Repo="https://github.com/welltop-cn/ComfyUI-TeaCache"; HasRequirements=$true},
249
- @{Name="ComfyUI-Crystools"; Repo="https://github.com/crystian/ComfyUI-Crystools"; HasRequirements=$true}
250
- )
251
- foreach ($node in $customNodes) {
252
- $nodePath = if ($node.Subfolder) { Join-Path $customNodesPath $node.Subfolder } else { Join-Path $customNodesPath $node.Name }
253
- if (-not (Test-Path $nodePath)) {
254
- Write-Log " - Installing $($node.Name)..."
255
- $cloneTargetPath = if ($node.Subfolder) { (Split-Path $nodePath -Parent) } else { $nodePath }
256
- if ($node.Name -eq 'ComfyUI-Impact-Subpack') { $clonePath = Join-Path $cloneTargetPath "impact_subpack" } else { $clonePath = $cloneTargetPath }
257
- Invoke-AndLog "git" "clone $($node.Repo) `"$clonePath`""
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
- } else { Write-Log " - $($node.Name) (already exists, skipping)" -Color Green }
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
- if (Test-Path $customNodesPath) {
84
- $nodeDirs = Get-ChildItem -Path $customNodesPath -Directory
85
- foreach ($dir in $nodeDirs) {
86
- Write-Log " - Checking node: $($dir.Name)"
87
- Invoke-Git-Pull -DirectoryPath $dir.FullName
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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