Keep the Extend panel put and name sibling clips as branches.

A finished job no longer closes a draft or jumps the page, and a second extend from the same part saves as p8b instead of another p8.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-02 15:16:30 -05:00
co-authored by Cursor
parent 4546aa5f61
commit 1be9bcb23f
9 changed files with 274 additions and 119 deletions
+7 -1
View File
@@ -5,6 +5,7 @@ import { readLoraStack } from '~/utils/loras'
import { parseExtendDuration } from '~/server/utils/extendChain'
import { defaultVideoSteps, isLtxWorkflow, LTX_DISABLED_MESSAGE, ltxWorkflowEnabled, parseVideoWorkflow } from '~/utils/videoModels'
import { composePromptParts } from '~/utils/promptParts'
import { nextFamilyPartName } from '~/server/utils/library'
export default defineEventHandler(async (event) => {
const body = await readBody<{ clipId?: string; prompt?: string; promptPre?: string; promptPost?: string; duration?: number; lora?: unknown; loraStack?: unknown }>(event).catch(() => ({}))
@@ -45,6 +46,10 @@ export default defineEventHandler(async (event) => {
const turbo = source.turbo !== false
const steps = Number(source.steps || defaultVideoSteps(turbo, workflow))
const seed = Math.floor(Math.random() * 2_147_483_647)
const reservedNames = listStudioJobs(owner)
.filter(job => job.status === 'waiting' || job.status === 'running' || job.status === 'held')
.map(job => job.name)
.filter(Boolean)
const studio = await addStudioJob({
ownerKey: owner,
@@ -54,7 +59,7 @@ export default defineEventHandler(async (event) => {
promptMid: prompt,
promptPre,
promptPost,
name: nextClipPartName(clipTitle(source)),
name: nextFamilyPartName(owner, source, reservedNames),
folderId: source.folderId,
aspect: source.aspect || '16:9',
width: source.width || 1344,
@@ -95,6 +100,7 @@ export default defineEventHandler(async (event) => {
queued: !liveJobId,
clientId: '',
seed,
name: studio.name,
width: source.width || 1344,
height: source.height || 768,
steps,