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
+19 -1
View File
@@ -58,6 +58,8 @@ export interface LibraryClip {
permanenceRefs?: PermanenceRef[]
loraName?: string
loraStack?: import('~/utils/loras').LoraStackItem[]
promptPre?: string
promptPost?: string
}
export type StillRole = 'input' | 'output'
@@ -74,6 +76,8 @@ export interface LibraryStill {
role: StillRole
name?: string
prompt?: string
promptPre?: string
promptPost?: string
familyId?: string
parentStillId?: string
chainIndex?: number
@@ -220,6 +224,8 @@ function normalizeStill(still: LibraryStill): LibraryStill {
role: stillRole(still),
name: still.name,
prompt: still.prompt,
promptPre: still.promptPre,
promptPost: still.promptPost,
familyId: still.familyId,
parentStillId: still.parentStillId,
chainIndex: still.chainIndex,
@@ -1210,6 +1216,8 @@ export async function saveStill(params: {
role?: StillRole
name?: string
prompt?: string
promptPre?: string
promptPost?: string
familyId?: string
parentStillId?: string
chainIndex?: number
@@ -1238,6 +1246,8 @@ export async function saveStill(params: {
item.role = role
if (name) item.name = name
if (prompt) item.prompt = prompt
if (params.promptPre != null) item.promptPre = params.promptPre || undefined
if (params.promptPost != null) item.promptPost = params.promptPost || undefined
if (params.familyId) item.familyId = params.familyId
if (params.parentStillId) item.parentStillId = params.parentStillId
if (typeof params.chainIndex === 'number') item.chainIndex = params.chainIndex
@@ -1247,6 +1257,8 @@ export async function saveStill(params: {
existing.role = role
if (name) existing.name = name
if (prompt) existing.prompt = prompt
if (params.promptPre != null) existing.promptPre = params.promptPre || undefined
if (params.promptPost != null) existing.promptPost = params.promptPost || undefined
if (nextSettings) existing.settings = nextSettings
}
return existing
@@ -1266,6 +1278,8 @@ export async function saveStill(params: {
role,
name: params.name?.trim().slice(0, 80) || undefined,
prompt: params.prompt || undefined,
promptPre: params.promptPre || undefined,
promptPost: params.promptPost || undefined,
familyId: params.familyId,
parentStillId: params.parentStillId,
chainIndex: params.chainIndex,
@@ -1554,6 +1568,8 @@ export async function saveClip(params: {
permanenceRefs?: PermanenceRef[]
loraName?: string
loraStack?: import('~/utils/loras').LoraStackItem[]
promptPre?: string
promptPost?: string
segmentFirstFrame?: Buffer
}) {
const catalog = readCatalog(params.ownerKey)
@@ -1587,7 +1603,9 @@ export async function saveClip(params: {
globalLocks: params.globalLocks,
permanenceRefs: params.permanenceRefs?.length ? normalizePermanenceRefs(params.permanenceRefs) : undefined,
loraName: params.loraName || undefined,
loraStack: params.loraStack?.length ? params.loraStack : undefined
loraStack: params.loraStack?.length ? params.loraStack : undefined,
promptPre: params.promptPre || undefined,
promptPost: params.promptPost || undefined
}
mkdirSync(clipDir(params.ownerKey, clip.id), { recursive: true })
const videoPath = clipVideoPath(params.ownerKey, clip.id)