Show generator settings in the library and restore them as input.
Collapse tiles so prompts stay behind the info button. Use as input opens the matching Video or Image v2 mode with the saved sliders. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+11
-3
@@ -7,6 +7,7 @@ import { promisify } from 'node:util'
|
||||
import type { H3Event } from 'h3'
|
||||
import { extractFirstFrame, extractFrameAt, extractLastFrame, probeDuration, remuxFaststart } from '~/server/utils/ffmpeg'
|
||||
import { normalizePermanenceRefs, type PermanenceRef } from '~/utils/globalLocks'
|
||||
import { normalizeStillSettings, type StillGenerationSettings } from '~/utils/libraryGeneration'
|
||||
|
||||
const scryptAsync = promisify(scrypt)
|
||||
|
||||
@@ -67,6 +68,7 @@ export interface LibraryStill {
|
||||
familyId?: string
|
||||
parentStillId?: string
|
||||
chainIndex?: number
|
||||
settings?: StillGenerationSettings
|
||||
}
|
||||
|
||||
export interface PublicFolder {
|
||||
@@ -205,7 +207,8 @@ function normalizeStill(still: LibraryStill): LibraryStill {
|
||||
prompt: still.prompt,
|
||||
familyId: still.familyId,
|
||||
parentStillId: still.parentStillId,
|
||||
chainIndex: still.chainIndex
|
||||
chainIndex: still.chainIndex,
|
||||
settings: normalizeStillSettings(still.settings)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1108,6 +1111,7 @@ export async function saveStill(params: {
|
||||
familyId?: string
|
||||
parentStillId?: string
|
||||
chainIndex?: number
|
||||
settings?: StillGenerationSettings
|
||||
}): Promise<LibraryStill | null> {
|
||||
if (lastFrameStillName(params.filename)) return null
|
||||
const role = params.role === 'output' ? 'output' : 'input'
|
||||
@@ -1123,7 +1127,8 @@ export async function saveStill(params: {
|
||||
const hideInput = typeof params.hideInput === 'boolean' ? params.hideInput === true : existing.hideInput
|
||||
const name = typeof params.name === 'string' ? params.name.trim().slice(0, 80) : existing.name
|
||||
const prompt = typeof params.prompt === 'string' ? params.prompt : existing.prompt
|
||||
if (existing.hideInput !== hideInput || existing.name !== name || existing.prompt !== prompt) {
|
||||
const nextSettings = params.settings ? normalizeStillSettings(params.settings) : undefined
|
||||
if (existing.hideInput !== hideInput || existing.name !== name || existing.prompt !== prompt || nextSettings) {
|
||||
await mutate(params.ownerKey, (next) => {
|
||||
const item = next.stills.find(still => still.id === existing.id)
|
||||
if (!item) return
|
||||
@@ -1134,11 +1139,13 @@ export async function saveStill(params: {
|
||||
if (params.familyId) item.familyId = params.familyId
|
||||
if (params.parentStillId) item.parentStillId = params.parentStillId
|
||||
if (typeof params.chainIndex === 'number') item.chainIndex = params.chainIndex
|
||||
if (nextSettings) item.settings = nextSettings
|
||||
})
|
||||
existing.hideInput = hideInput
|
||||
existing.role = role
|
||||
if (name) existing.name = name
|
||||
if (prompt) existing.prompt = prompt
|
||||
if (nextSettings) existing.settings = nextSettings
|
||||
}
|
||||
return existing
|
||||
}
|
||||
@@ -1159,7 +1166,8 @@ export async function saveStill(params: {
|
||||
prompt: params.prompt || undefined,
|
||||
familyId: params.familyId,
|
||||
parentStillId: params.parentStillId,
|
||||
chainIndex: params.chainIndex
|
||||
chainIndex: params.chainIndex,
|
||||
settings: normalizeStillSettings(params.settings)
|
||||
}
|
||||
mkdirSync(join(ownerRoot(params.ownerKey), 'stills'), { recursive: true })
|
||||
writeFileSync(stillPath(params.ownerKey, still.id), params.data)
|
||||
|
||||
Reference in New Issue
Block a user