Add default video length setting and inherit duration when extending.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user