Copy generated stills into Input without loading the current frame.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-31 22:57:54 -05:00
co-authored by Cursor
parent 835a7bcd68
commit 5037c4fdeb
5 changed files with 169 additions and 11 deletions
+23
View File
@@ -1280,6 +1280,29 @@ export async function saveStill(params: {
return still
}
export async function keepStillAsInput(owner: string, id: string) {
const still = getStill(owner, id)
if (stillRole(still) === 'input') return still
const path = stillPath(owner, still.id)
if (!existsSync(path)) throw createError({ statusCode: 404, statusMessage: 'Image file missing' })
const data = readFileSync(path)
const name = (still.name || still.filename.replace(/\.[a-z0-9]+$/i, '') || 'still').trim().slice(0, 80)
const base = lastFrameStillName(name) || clipIdFromStillFilename(`${name}.png`) ? 'still' : name
const saved = await saveStill({
ownerKey: owner,
folderId: still.folderId,
filename: `${base}.png`,
data,
width: still.width,
height: still.height,
hideInput: still.hideInput,
role: 'input',
name
})
if (!saved) throw createError({ statusCode: 400, statusMessage: 'Could not save that still as input' })
return saved
}
export async function rememberInputStill(params: {
ownerKey: string
folderId: string