Stop wiping Comfy inputs and sibling outputs during disk cleanup.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { AsyncLocalStorage } from 'node:async_hooks'
|
||||
import { getComfyHost, viaAgentFrontDoor, comfySweepNamePrefixes } from '~/server/utils/comfy'
|
||||
import { getComfyHost, viaAgentFrontDoor } from '~/server/utils/comfy'
|
||||
import { comfyJobPrefix } from '~/utils/outputNames'
|
||||
|
||||
const imageHostAls = new AsyncLocalStorage<string>()
|
||||
@@ -385,12 +385,8 @@ async function purgeImageOnDesktop(opts: {
|
||||
...(token ? { Authorization: `Bearer ${token}` } : {})
|
||||
},
|
||||
body: JSON.stringify({
|
||||
imageName: opts.inputName || '',
|
||||
imageSubfolder: opts.inputSubfolder || '',
|
||||
imageNames: (opts.extraInputNames || []).filter(Boolean),
|
||||
output: opts.output || null,
|
||||
sweepPrefixes: comfySweepNamePrefixes(),
|
||||
sweepSubfolders: ['video', 'audio', 'image', 'still']
|
||||
sweep: false
|
||||
}),
|
||||
signal: AbortSignal.timeout(8000)
|
||||
})
|
||||
@@ -415,28 +411,10 @@ export async function purgeImageComfyArtifacts(opts: {
|
||||
type: opts.output.type || 'output'
|
||||
})
|
||||
}
|
||||
if (opts.inputName) {
|
||||
files.push({
|
||||
filename: opts.inputName,
|
||||
subfolder: opts.inputSubfolder || '',
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user