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
+7 -7
View File
@@ -1,7 +1,7 @@
import { createJob, emitJob, type Job } from '~/server/utils/jobs'
import { ensureComfyReady } from '~/server/utils/comfyLifecycle'
import { assertImageScaleToTotalPixelsNode, getComfyHost, uploadImage, queuePrompt, purgeComfyArtifacts } from '~/server/utils/comfy'
import { withImageComfyHost, waitForImageEdit, downloadEditedImage } from '~/server/utils/imageComfy'
import { assertImageScaleToTotalPixelsNode, getComfyHost, uploadImage, queuePrompt } from '~/server/utils/comfy'
import { withImageComfyHost, waitForImageEdit, downloadEditedImage, purgeImageComfyArtifacts } from '~/server/utils/imageComfy'
import { buildImageV2Workflow, IMAGE_V2_NODE_LABELS, resolveKreaGenerateAssets } from '~/server/utils/imageWorkflowV2'
import { ensureComfyLoraNames, persistLoraFields } from '~/server/utils/loras'
import { imageDimensions } from '~/server/utils/resolution'
@@ -321,11 +321,11 @@ export async function runEditV2(job: Job, params: EditV2RunParams) {
})
job.stillId = still?.id
if (!batch) parentStillId = still?.id
await purgeComfyArtifacts({
video: { filename: output.filename, subfolder: output.subfolder, type: output.type },
imageName: uploaded?.name,
imageSubfolder: uploaded?.subfolder,
extraImageNames: last
await purgeImageComfyArtifacts({
output: { filename: output.filename, subfolder: output.subfolder, type: output.type },
inputName: uploaded?.name,
inputSubfolder: uploaded?.subfolder,
extraInputNames: last
? [uploadedRef?.name, uploadedMask?.name].filter((name): name is string => Boolean(name))
: [],
promptId: job.promptId