Give video extensions the same pre-text, prompt, and post-text fields as the main form.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -22,7 +22,8 @@ import {
|
||||
updateShotQueue
|
||||
} from '~/server/utils/shotQueue'
|
||||
import { composeShotPrompt, allowIdentityRefs, type PermanenceRef } from '~/utils/globalLocks'
|
||||
import { composePromptParts } from '~/utils/promptParts'
|
||||
import { composePromptParts, resolvePromptWrappers } from '~/utils/promptParts'
|
||||
import type { QueuedExtension } from '~/server/utils/library'
|
||||
import { persistLoraFields, ensureComfyLoraNames } from '~/server/utils/loras'
|
||||
import { readLoraStack, resolveLoraStack } from '~/utils/loras'
|
||||
import type { LoraStackItem } from '~/utils/loras'
|
||||
@@ -43,7 +44,7 @@ type VideoChainParams = {
|
||||
fps: number
|
||||
samplerName: string
|
||||
scheduler: string
|
||||
extensions: { prompt: string; duration: number; loraName?: string; loraStack?: LoraStackItem[]; permanenceRefs?: PermanenceRef[] }[]
|
||||
extensions: QueuedExtension[]
|
||||
workflow: VideoWorkflowId
|
||||
duration: number
|
||||
useIdentityRefs: boolean
|
||||
@@ -323,11 +324,12 @@ export async function continueQueuedExtensions(
|
||||
prompt: live.prompt || extensions[i].prompt,
|
||||
duration: live.duration || extensions[i].duration
|
||||
}
|
||||
const wrappers = resolvePromptWrappers(live, extensions[i], job.library)
|
||||
const shotStack = resolveLoraStack(
|
||||
readLoraStack(liveQueue).length ? readLoraStack(liveQueue) : (params.loraStack || params.loraName),
|
||||
live.loraStack || live.loraName || extensions[i]?.loraStack || extensions[i]?.loraName
|
||||
)
|
||||
if (!ext.prompt.trim()) {
|
||||
if (!composePromptParts(wrappers.promptPre, ext.prompt, wrappers.promptPost)) {
|
||||
throw new Error(`Shot ${i + 2} needs a prompt`)
|
||||
}
|
||||
|
||||
@@ -385,7 +387,10 @@ export async function continueQueuedExtensions(
|
||||
throw new Error('Could not extract the last frame for the next extension: the frame file was empty')
|
||||
}
|
||||
job.library.extendPart1Path = part1Path
|
||||
job.library.prompt = ext.prompt
|
||||
job.library.prompt = composePromptParts(wrappers.promptPre, ext.prompt, wrappers.promptPost)
|
||||
job.library.promptMid = ext.prompt
|
||||
job.library.promptPre = wrappers.promptPre || undefined
|
||||
job.library.promptPost = wrappers.promptPost || undefined
|
||||
if (live.permanenceRefs?.length) {
|
||||
const refs = [...(job.library.shotPermanenceRefs || [])]
|
||||
refs[i + 1] = live.permanenceRefs
|
||||
|
||||
Reference in New Issue
Block a user