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:
@@ -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 }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user