Purge identity refs from desktop Comfy and keep them in the server stills library.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-27 08:12:54 -05:00
co-authored by Cursor
parent 1466762af4
commit 72f4909815
6 changed files with 48 additions and 6 deletions
+6 -3
View File
@@ -181,9 +181,12 @@ function readJson(req) {
function purgeDesktopFiles(body) {
const deleted = []
const imageName = String(body?.imageName || body?.filename || '')
const names = [
String(body?.imageName || body?.filename || ''),
...(Array.isArray(body?.imageNames) ? body.imageNames : [])
].map(name => String(name || '').trim()).filter(Boolean)
const imageSub = String(body?.imageSubfolder || '')
if (imageName) {
for (const imageName of names) {
for (const root of inputRoots()) {
if (!existsSync(root)) continue
const nested = safeFile(root, imageSub, imageName)
@@ -220,7 +223,7 @@ function purgeDesktopFiles(body) {
}
}
}
console.log(JSON.stringify({ src: 'comfy-host-agent', event: 'purge', deleted: deleted.length, files: deleted.map((path) => basename(path)), imageName }))
console.log(JSON.stringify({ src: 'comfy-host-agent', event: 'purge', deleted: deleted.length, files: deleted.map((path) => basename(path)), imageNames: names }))
return { ok: true, deleted }
}