Pause the queue after the current clip for real, and carry global locks plus labeled permanence stills through generate and shot prompts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-28 07:48:09 -05:00
co-authored by Cursor
parent 010ef6add2
commit efef409537
21 changed files with 1196 additions and 115 deletions
+16 -4
View File
@@ -1,6 +1,7 @@
import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs'
import { join } from 'node:path'
import type { Job } from '~/server/utils/jobs'
import { mergePermanenceRefs } from '~/utils/globalLocks'
export interface PendingJob {
jobId: string
@@ -35,6 +36,9 @@ export interface PendingJob {
referenceImageNames?: string[]
referenceStillIds?: Array<string | null>
useIdentityRefs?: boolean
globalLocks?: string
permanenceRefs?: import('~/utils/globalLocks').PermanenceRef[]
shotPermanenceRefs?: import('~/utils/globalLocks').PermanenceRef[][]
workflow?: import('~/utils/videoModels').VideoWorkflowId
duration?: number
cfg?: number
@@ -42,8 +46,8 @@ export interface PendingJob {
samplerName?: string
scheduler?: string
hideInput?: boolean
extensions?: { prompt: string; duration: number }[]
remainingExtensions?: { prompt: string; duration: number }[]
extensions?: { prompt: string; duration: number; permanenceRefs?: import('~/utils/globalLocks').PermanenceRef[] }[]
remainingExtensions?: { prompt: string; duration: number; permanenceRefs?: import('~/utils/globalLocks').PermanenceRef[] }[]
currentClipId?: string
queueId?: string
queueAutoRun?: boolean
@@ -130,6 +134,9 @@ export function pendingFromJob(job: Job, overrides: Partial<PendingJob> = {}): P
extensions: library.extensions,
remainingExtensions: remaining,
currentClipId: job.clipId,
globalLocks: library.globalLocks,
permanenceRefs: library.permanenceRefs,
shotPermanenceRefs: library.shotPermanenceRefs,
queueId: library.queueId,
queueAutoRun: library.queueAutoRun,
queueBudget: library.queueBudget,
@@ -177,7 +184,10 @@ export function libraryFromPending(pending: PendingJob): NonNullable<Job['librar
extensions: pending.extensions || pending.remainingExtensions,
queueId: pending.queueId,
queueAutoRun: pending.queueAutoRun,
queueBudget: pending.queueBudget
queueBudget: pending.queueBudget,
globalLocks: pending.globalLocks,
permanenceRefs: pending.permanenceRefs,
shotPermanenceRefs: pending.shotPermanenceRefs
}
}
@@ -287,7 +297,9 @@ export async function completePendingIfReady(pending: PendingJob) {
parentClipId: pending.parentClipId,
chainIndex: pending.chainIndex,
stillId: pending.stillId,
sound: pending.sound
sound: pending.sound,
globalLocks: pending.globalLocks,
permanenceRefs: mergePermanenceRefs(pending.permanenceRefs, pending.shotPermanenceRefs?.[pending.chainIndex || 0])
})
await purgeComfyArtifacts({
video,