Stop a deleted video chain from keeping the GPU.
Interrupt now clears Comfy, and a missing shot list no longer continues to the next extension. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -259,10 +259,13 @@ function seedCurrentVideo(job: Job) {
|
||||
|
||||
function chainShouldHold(job: Job) {
|
||||
if (!job.library) return false
|
||||
if (job.status === 'cancelled' || job.status === 'error') return true
|
||||
if (job.library.stopAfterCurrent) return true
|
||||
if (job.library.queueId && isShotQueueCancelled(job.library.queueId)) return true
|
||||
const queue = job.library.queueId
|
||||
? getShotQueue(job.library.ownerKey, job.library.queueId)
|
||||
: null
|
||||
if (job.library.queueId && !queue) return true
|
||||
if (queue?.stopAfterCurrent || queue?.status === 'paused') return true
|
||||
return false
|
||||
}
|
||||
@@ -371,6 +374,11 @@ export async function continueQueuedExtensions(
|
||||
? detail
|
||||
: `Could not extract the last frame for the next extension: ${detail}`)
|
||||
}
|
||||
assertJobActive(job)
|
||||
if (chainShouldHold(job)) {
|
||||
job.library.stopAfterCurrent = true
|
||||
break
|
||||
}
|
||||
const frame = readFileSync(framePath)
|
||||
if (!frame.length || frame.length < 64) {
|
||||
throw new Error('Could not extract the last frame for the next extension: the frame file was empty')
|
||||
@@ -391,7 +399,17 @@ export async function continueQueuedExtensions(
|
||||
job.library.shotPermanenceRefs || params.shotPermanenceRefs
|
||||
)
|
||||
|
||||
assertJobActive(job)
|
||||
if (chainShouldHold(job)) {
|
||||
job.library.stopAfterCurrent = true
|
||||
break
|
||||
}
|
||||
await ensureComfyReady(ready)
|
||||
assertJobActive(job)
|
||||
if (chainShouldHold(job)) {
|
||||
job.library.stopAfterCurrent = true
|
||||
break
|
||||
}
|
||||
await queueMiniMax(job, {
|
||||
prompt: ext.prompt,
|
||||
image: { filename: 'last_frame.png', data: frame, type: 'image/png' },
|
||||
|
||||
Reference in New Issue
Block a user