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:
Towsty
2026-09-03 07:17:00 -05:00
co-authored by Cursor
parent f05f8f3597
commit 1206afe8fd
9 changed files with 86 additions and 32 deletions
+7 -3
View File
@@ -22,7 +22,7 @@ import {
updateShotQueue
} from '~/server/utils/shotQueue'
import { composeShotPrompt, allowIdentityRefs, type PermanenceRef } from '~/utils/globalLocks'
import { composePromptParts, joinPromptParts, resolvePromptWrappers } from '~/utils/promptParts'
import { composePromptParts, joinPromptParts, resolvePromptWrappers, wrappedPromptForComfy } from '~/utils/promptParts'
import type { QueuedExtension } from '~/server/utils/library'
import { persistLoraFields, ensureComfyLoraNames } from '~/server/utils/loras'
import { readLoraStack, resolveLoraStack } from '~/utils/loras'
@@ -191,7 +191,7 @@ export async function queueMiniMax(
const shotIndex = job.library?.chainIndex || 0
const composedPrompt = composeShotPrompt({
globalLocks: job.library?.globalLocks || params.globalLocks,
prompt: joinPromptParts(job.library?.promptPre, params.prompt, job.library?.promptPost),
prompt: wrappedPromptForComfy(job.library, job.library?.promptMid, params.prompt),
shotIndex,
familyRefs: job.library?.permanenceRefs || params.permanenceRefs,
shotRefs: job.library?.shotPermanenceRefs?.[shotIndex] || params.shotPermanenceRefs?.[shotIndex]
@@ -566,6 +566,7 @@ export async function startQueueBurst(owner: string, queueId: string, count: num
}
const source = getClip(owner, clipId)
const destFolderLocked = false
const nextSegment = queue.segments.find(segment => segment.index === lastIndex + 1)
const job = createJob()
job.kind = 'video'
job.maxStep = queue.steps
@@ -578,7 +579,10 @@ export async function startQueueBurst(owner: string, queueId: string, count: num
hideInput: queue.hideInput,
folderLocked: destFolderLocked,
name: nextFamilyPartName(owner, source),
prompt: queue.segments[lastIndex]?.prompt || source.prompt,
prompt: nextSegment?.prompt || queue.segments[lastIndex]?.prompt || source.prompt,
promptMid: nextSegment?.prompt || queue.segments[lastIndex]?.prompt || source.prompt,
promptPre: queue.promptPre || source.promptPre,
promptPost: queue.promptPost || source.promptPost,
aspect: queue.aspect,
width: queue.width,
height: queue.height,