Stop wiping Comfy inputs and sibling outputs during disk cleanup.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-03 18:16:56 -05:00
co-authored by Cursor
parent de433c40d3
commit a6756c1f1a
3 changed files with 24 additions and 53 deletions
+6 -10
View File
@@ -595,6 +595,8 @@ async function purgeOnDesktop(opts: {
const token = String(config.comfyControlToken || process.env.COMFY_CONTROL_TOKEN || '')
if (!controlUrl) return
try {
// Exact files only. Do not sweep other MiniMax/LTX outputs or inputs —
// those are still part of the desktop workflow and recover path.
await fetch(`${controlUrl}/purge`, {
method: 'POST',
headers: {
@@ -603,14 +605,10 @@ async function purgeOnDesktop(opts: {
...(token ? { Authorization: `Bearer ${token}` } : {})
},
body: JSON.stringify({
imageName: opts.imageName || '',
imageSubfolder: opts.imageSubfolder || '',
imageNames: (opts.extraImageNames || []).filter(Boolean),
video: opts.video || null,
audio: opts.audio || null,
output: opts.output || (opts.video && /\.(png|jpe?g|webp|gif)$/i.test(opts.video.filename) ? opts.video : null),
sweepPrefixes: comfySweepNamePrefixes(),
sweepSubfolders: ['video', 'audio', 'image', 'still']
sweep: false
}),
signal: AbortSignal.timeout(12000)
})
@@ -630,15 +628,13 @@ export async function purgeComfyArtifacts(opts: {
}) {
if (!purgeComfyEnabled()) return
await purgeOnDesktop(opts)
// Only remove the output we already copied into the library.
// Leave Comfy input stills / identity refs on disk — shot chains and
// desktop recover still need them.
const files: ComfyDiskFile[] = []
if (opts.video?.filename) files.push(opts.video)
if (opts.audio?.filename) files.push(opts.audio)
if (opts.output?.filename) files.push(opts.output)
if (opts.imageName) files.push({ filename: opts.imageName, subfolder: opts.imageSubfolder || '', type: 'input' })
for (const name of opts.extraImageNames || []) {
if (!name || name === opts.imageName) continue
files.push({ filename: name, subfolder: opts.imageSubfolder || '', type: 'input' })
}
for (const file of files) {
await deleteComfyHttpFile(file)
}