Delete imported Comfy stills from disk instead of looking for them in the video folder.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-03 00:02:17 -05:00
co-authored by Cursor
parent 5555155884
commit 9cb8b9bda3
5 changed files with 99 additions and 53 deletions
+13 -1
View File
@@ -365,6 +365,7 @@ async function deleteSidecarFile(file: { filename: string; subfolder?: string; t
async function purgeImageOnDesktop(opts: {
inputName?: string
inputSubfolder?: string
extraInputNames?: string[]
output?: { filename: string; subfolder: string; type: string }
}) {
const config = useRuntimeConfig()
@@ -382,9 +383,10 @@ async function purgeImageOnDesktop(opts: {
body: JSON.stringify({
imageName: opts.inputName || '',
imageSubfolder: opts.inputSubfolder || '',
imageNames: (opts.extraInputNames || []).filter(Boolean),
output: opts.output || null
}),
signal: AbortSignal.timeout(4000)
signal: AbortSignal.timeout(8000)
})
} catch {
/* Host agent purge is optional; Comfy HTTP delete is the primary path. */
@@ -395,6 +397,7 @@ export async function purgeImageComfyArtifacts(opts: {
output?: { filename: string; subfolder: string; type: string }
inputName?: string
inputSubfolder?: string
extraInputNames?: string[]
promptId?: string
}) {
if (!purgeImageEnabled()) return
@@ -413,12 +416,21 @@ export async function purgeImageComfyArtifacts(opts: {
type: 'input'
})
}
for (const name of opts.extraInputNames || []) {
if (!name || name === opts.inputName) continue
files.push({
filename: name,
subfolder: opts.inputSubfolder || '',
type: 'input'
})
}
for (const file of files) {
await deleteSidecarFile(file)
}
await purgeImageOnDesktop({
inputName: opts.inputName,
inputSubfolder: opts.inputSubfolder,
extraInputNames: opts.extraInputNames,
output: opts.output
})
if (opts.promptId) {