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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user