Add default video length setting and inherit duration when extending.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-03 19:44:28 -05:00
co-authored by Cursor
parent a6756c1f1a
commit 86e23499a9
5 changed files with 116 additions and 25 deletions
+8 -2
View File
@@ -2,7 +2,7 @@ import { existsSync } from 'node:fs'
import { addStudioJob, kickStudioQueue, listStudioJobs, videoJobsBusy } from '~/server/utils/studioQueue'
import { persistLoraFields, parsePostedLoraStack, listStudioLoras } from '~/server/utils/loras'
import { readLoraStack } from '~/utils/loras'
import { parseExtendDuration } from '~/server/utils/extendChain'
import { clipPartDuration, clampVideoDuration } from '~/utils/videoDuration'
import { defaultVideoSteps, isLtxWorkflow, LTX_DISABLED_MESSAGE, ltxWorkflowEnabled, parseVideoWorkflow } from '~/utils/videoModels'
import { composePromptParts } from '~/utils/promptParts'
import { nextFamilyPartName } from '~/server/utils/library'
@@ -25,7 +25,13 @@ export default defineEventHandler(async (event) => {
const destFolder = publicLibrary(event).folders.find(folder => folder.id === source.folderId)
const folderLocked = Boolean(destFolder?.protected && !destFolder.unlocked)
const durationSeconds = parseExtendDuration(body?.duration)
const parent = source.parentClipId
? (() => { try { return getClip(owner, source.parentClipId!) } catch { return null } })()
: null
const inherited = clipPartDuration(source, parent)
const durationSeconds = body?.duration == null
? inherited
: clampVideoDuration(body.duration, inherited)
const promptPre = body && Object.prototype.hasOwnProperty.call(body, 'promptPre')
? String(body.promptPre || '').trim()
: String(source.promptPre || '').trim()