# Delete named YuE v1 / YuEGP weight folders only. Never recurse-wipe Comfy models\ or custom_nodes\. [CmdletBinding()] param( [string]$YueGpRoot = 'C:\Users\ianjm\Development\YuEGP', [string]$YueModels = '', [string]$LogPath = '' ) $ErrorActionPreference = 'Continue' if (-not $YueModels) { $YueModels = Join-Path $env:LOCALAPPDATA 'Comfy-Desktop\ComfyUI-Shared\models\yue' } if (-not $LogPath) { $LogPath = Join-Path $PSScriptRoot 'cleanup-yue-v1.log' } function Log([string]$Message) { $line = "$(Get-Date -Format o) $Message" Add-Content -LiteralPath $LogPath -Value $line Write-Host $line } function RemoveNamed([string]$Path) { if (-not $Path) { return } if (!(Test-Path -LiteralPath $Path)) { Log "SKIP missing $Path" return } try { Remove-Item -LiteralPath $Path -Recurse -Force Log "DELETED $Path" } catch { Log "FAIL $Path :: $($_.Exception.Message)" } } Log "START cleanup-yue-v1 YueGpRoot=$YueGpRoot YueModels=$YueModels" # Stage 1 / Stage 2 + codec under the shared yue models dir (named folders only) RemoveNamed (Join-Path $YueModels 'YuE-s1-7B-anneal-en-cot') RemoveNamed (Join-Path $YueModels 'YuE-s2-1B-general') RemoveNamed (Join-Path $YueModels 'xcodec_mini_infer') # Loose codec files that live beside the stage folders in this install foreach ($name in @('ckpt_00360000.pth', 'decoder_131000.pth', 'decoder_151000.pth')) { RemoveNamed (Join-Path $YueModels $name) } # YuEGP checkout codec copy + job dumps RemoveNamed (Join-Path $YueGpRoot 'inference\xcodec_mini_infer') RemoveNamed (Join-Path $YueGpRoot 'aigen-jobs') # Hugging Face cache dirs that are clearly YuE v1 / old codec $Hf = Join-Path $env:USERPROFILE '.cache\huggingface\hub' RemoveNamed (Join-Path $Hf 'models--m-a-p--YuE-s1-7B-anneal-en-cot') RemoveNamed (Join-Path $Hf 'models--m-a-p--YuE-s2-1B-general') RemoveNamed (Join-Path $Hf 'models--m-a-p--xcodec_mini_infer') # Leftover Comfy YuE Stage A/B weight copies by name only (no blanket models\ purge) $ComfyModels = Join-Path $env:LOCALAPPDATA 'Comfy-Desktop\ComfyUI-Shared\models' if (Test-Path -LiteralPath $ComfyModels) { Get-ChildItem -LiteralPath $ComfyModels -Recurse -ErrorAction SilentlyContinue | Where-Object { $_.Name -match '^(YUE_Stage_|YuE-s1-|YuE-s2-|yue_stage)' } | ForEach-Object { RemoveNamed $_.FullName } } else { Log "SKIP missing $ComfyModels" } Log "DONE cleanup-yue-v1 log=$LogPath" Write-Host "Left in place: ACE / H3 / Klein / Krea / LTX / upscale / LoRAs / LIBRARY_DIR / yuegp code paths."