Split prompts into pre/prompt/post and tidy the AIGen video form.

Keep wrappers off the library mid-prompt so Use as input and Extend restore the same split, send stills to xAIGen as hidden inputs, and stop the two-column library from growing with the list.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-01 18:39:02 -05:00
co-authored by Cursor
parent ed04dcfee3
commit f788fd4bb4
22 changed files with 753 additions and 199 deletions
+9 -3
View File
@@ -5,6 +5,7 @@ import type { LoraStackItem } from '~/utils/loras'
import { clampVideoCfg } from '~/utils/generationPresets'
import { defaultVideoSteps, isLtxWorkflow, isTextToVideo, LTX_DISABLED_MESSAGE, ltxWorkflowEnabled, parseVideoWorkflow, videoEngineOf } from '~/utils/videoModels'
import { allowIdentityRefs, normalizePermanenceRefs, resolveGlobalLocks, type PermanenceRef } from '~/utils/globalLocks'
import { composePromptParts } from '~/utils/promptParts'
function parseDuration(raw: unknown) {
const seconds = Number(raw)
@@ -137,11 +138,13 @@ export default defineEventHandler(async (event) => {
if (!image && !textToVideo) {
throw createError({ statusCode: 400, statusMessage: 'An initial image is required' })
}
const promptRaw = (fields.prompt || '').trim()
if (!promptRaw) {
const promptMid = (fields.prompt || '').trim()
const promptPre = (fields.promptPre || '').trim()
const promptPost = (fields.promptPost || '').trim()
if (!composePromptParts(promptPre, promptMid, promptPost)) {
throw createError({ statusCode: 400, statusMessage: 'A motion prompt is required' })
}
const resolvedLocks = resolveGlobalLocks(fields.globalLocks || '', promptRaw)
const resolvedLocks = resolveGlobalLocks(fields.globalLocks || '', promptMid)
const prompt = resolvedLocks.prompt
const globalLocks = resolvedLocks.locks
const extensions = parseExtensions(fields.extensions)
@@ -243,6 +246,9 @@ export default defineEventHandler(async (event) => {
familyId,
payload: {
prompt,
promptMid: promptMid || undefined,
promptPre: promptPre || undefined,
promptPost: promptPost || undefined,
name: clipName,
folderId,
aspect: fields.aspect || 'auto',