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
+7
View File
@@ -293,6 +293,7 @@ async function purgeOnDesktop(opts: {
video?: { filename: string; subfolder: string; type: string }
imageName?: string
imageSubfolder?: string
extraImageNames?: string[]
}) {
const config = useRuntimeConfig()
const controlUrl = String(config.comfyControlUrl || process.env.COMFY_CONTROL_URL || '').replace(/\/$/, '')
@@ -309,6 +310,7 @@ async function purgeOnDesktop(opts: {
body: JSON.stringify({
imageName: opts.imageName || '',
imageSubfolder: opts.imageSubfolder || '',
imageNames: (opts.extraImageNames || []).filter(Boolean),
video: opts.video || null
}),
signal: AbortSignal.timeout(8000)
@@ -322,6 +324,7 @@ export async function purgeComfyArtifacts(opts: {
video?: { filename: string; subfolder: string; type: string }
imageName?: string
imageSubfolder?: string
extraImageNames?: string[]
promptId?: string
}) {
if (!purgeComfyEnabled()) return
@@ -329,6 +332,10 @@ export async function purgeComfyArtifacts(opts: {
const files: { filename: string; subfolder: string; type: string }[] = []
if (opts.video?.filename) files.push(opts.video)
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) {
try {
await comfyFetch('/aigen/purge', {