Keep family pre/post text on shot queues and wrap the mid prompt at Comfy time.
Later shots were starting a new job without those wrappers, so only the first clip got them. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -56,6 +56,8 @@ export interface ShotQueue {
|
||||
permanenceRefs?: import('~/utils/globalLocks').PermanenceRef[]
|
||||
loraName?: string
|
||||
loraStack?: LoraStackItem[]
|
||||
promptPre?: string
|
||||
promptPost?: string
|
||||
segments: ShotQueueSegment[]
|
||||
lastError?: string
|
||||
}
|
||||
@@ -190,7 +192,9 @@ export async function createShotQueue(params: {
|
||||
permanenceRefs?: import('~/utils/globalLocks').PermanenceRef[]
|
||||
loraName?: string
|
||||
loraStack?: LoraStackItem[]
|
||||
initial: { prompt: string; duration: number; permanenceRefs?: import('~/utils/globalLocks').PermanenceRef[]; loraName?: string; loraStack?: LoraStackItem[] }
|
||||
promptPre?: string
|
||||
promptPost?: string
|
||||
initial: { prompt: string; promptPre?: string; promptPost?: string; duration: number; permanenceRefs?: import('~/utils/globalLocks').PermanenceRef[]; loraName?: string; loraStack?: LoraStackItem[] }
|
||||
extensions: QueuedExtension[]
|
||||
jobId?: string
|
||||
}): Promise<ShotQueue> {
|
||||
@@ -227,8 +231,18 @@ export async function createShotQueue(params: {
|
||||
permanenceRefs: params.permanenceRefs,
|
||||
loraName: params.loraName,
|
||||
loraStack: params.loraStack,
|
||||
...persistPromptWrappers(params),
|
||||
segments: [
|
||||
{ index: 0, prompt: params.initial.prompt, duration: params.initial.duration, status: 'running', permanenceRefs: params.initial.permanenceRefs, ...persistLoraFields(params.initial.loraStack || params.initial.loraName) },
|
||||
{
|
||||
index: 0,
|
||||
prompt: params.initial.prompt,
|
||||
duration: params.initial.duration,
|
||||
status: 'running',
|
||||
permanenceRefs: params.initial.permanenceRefs,
|
||||
...persistLoraFields(params.initial.loraStack || params.initial.loraName),
|
||||
...persistPromptWrappers(params),
|
||||
...persistPromptWrappers(params.initial)
|
||||
},
|
||||
...params.extensions.map((item, index) => ({
|
||||
index: index + 1,
|
||||
prompt: item.prompt,
|
||||
@@ -236,6 +250,7 @@ export async function createShotQueue(params: {
|
||||
status: 'pending' as const,
|
||||
permanenceRefs: item.permanenceRefs,
|
||||
...persistLoraFields(item.loraStack || item.loraName),
|
||||
...persistPromptWrappers(params),
|
||||
...persistPromptWrappers(item)
|
||||
}))
|
||||
]
|
||||
@@ -479,6 +494,7 @@ export function listOwnersWithQueues() {
|
||||
}
|
||||
|
||||
export function remainingFromQueue(queue: ShotQueue): QueuedExtension[] {
|
||||
const family = persistPromptWrappers(queue)
|
||||
return queue.segments
|
||||
.filter(segment => segment.index > 0)
|
||||
.map(segment => ({
|
||||
@@ -486,6 +502,7 @@ export function remainingFromQueue(queue: ShotQueue): QueuedExtension[] {
|
||||
duration: segment.duration,
|
||||
permanenceRefs: segment.permanenceRefs,
|
||||
...persistLoraFields(segment.loraStack || segment.loraName),
|
||||
...family,
|
||||
...persistPromptWrappers(segment)
|
||||
}))
|
||||
}
|
||||
@@ -503,6 +520,7 @@ export function liveSegmentPrompt(queue: ShotQueue, extensionIndex: number) {
|
||||
duration: segment?.duration || 5,
|
||||
permanenceRefs: segment?.permanenceRefs,
|
||||
...persistLoraFields(segment?.loraStack || segment?.loraName),
|
||||
...persistPromptWrappers(queue),
|
||||
...persistPromptWrappers(segment)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user