46 lines
1.3 KiB
PowerShell
46 lines
1.3 KiB
PowerShell
param(
|
|
[Parameter(Mandatory=$false)]
|
|
[string]$ComfyUIPath,
|
|
|
|
[Parameter(Mandatory=$false)]
|
|
[string]$CustomNodesPath
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$PackageDirName = "ComfyUI-Brightwire-Tools"
|
|
$RepoRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
$SourceRoot = Join-Path $RepoRoot "custom_nodes\$PackageDirName"
|
|
|
|
if (!(Test-Path $SourceRoot)) {
|
|
throw "Custom node package folder not found: $SourceRoot"
|
|
}
|
|
|
|
if ([string]::IsNullOrWhiteSpace($CustomNodesPath)) {
|
|
if ([string]::IsNullOrWhiteSpace($ComfyUIPath)) {
|
|
throw "Pass -ComfyUIPath C:\path\to\ComfyUI or -CustomNodesPath C:\path\to\ComfyUI\custom_nodes"
|
|
}
|
|
|
|
if (!(Test-Path $ComfyUIPath)) {
|
|
throw "ComfyUI path does not exist: $ComfyUIPath"
|
|
}
|
|
|
|
$CustomNodesPath = Join-Path $ComfyUIPath "custom_nodes"
|
|
}
|
|
|
|
if (!(Test-Path $CustomNodesPath)) {
|
|
New-Item -ItemType Directory -Path $CustomNodesPath | Out-Null
|
|
}
|
|
|
|
$TargetRoot = Join-Path $CustomNodesPath $PackageDirName
|
|
|
|
if (Test-Path $TargetRoot) {
|
|
Write-Host "Removing existing install: $TargetRoot"
|
|
Remove-Item -Recurse -Force $TargetRoot
|
|
}
|
|
|
|
Write-Host "Installing Brightwire Tools to: $TargetRoot"
|
|
Copy-Item $SourceRoot -Destination $TargetRoot -Recurse -Force
|
|
|
|
Write-Host "Done. Restart ComfyUI and hard-refresh your browser."
|