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
+27
View File
@@ -245,6 +245,13 @@
<div class="mt-4 flex flex-wrap gap-2">
<button type="button" class="rounded-full border border-amber-300/40 px-3 py-1.5 text-xs text-amber-100" @click="openInStudio(focused)">Open in Studio</button>
<button type="button" class="rounded-full border border-white/10 px-3 py-1.5 text-xs text-zinc-300 hover:text-white" @click="useInStudio(focused)">Use as input</button>
<button
v-if="focused.kind === 'still' && focusedStillRole !== 'input'"
type="button"
class="rounded-full border border-white/10 px-3 py-1.5 text-xs text-zinc-300 hover:text-white"
:disabled="keepingInputBusy"
@click="saveFocusedAsInput"
>{{ keepingInputBusy ? 'Saving…' : 'Save as input' }}</button>
<a
v-if="downloadHref"
:href="downloadHref"
@@ -374,6 +381,7 @@ const renameInput = ref<HTMLInputElement | null>(null)
const deleteBusy = ref(false)
const detailsHidden = ref(false)
const pendingDelete = ref<{ title: string; name: string; detail?: string; consequence: string; keys: string[] } | null>(null)
const keepingInputBusy = ref(false)
const toasts = ref<Array<{ id: number; message: string }>>([])
let toastId = 0
let searchTimer: ReturnType<typeof setTimeout> | null = null
@@ -420,6 +428,11 @@ const folderChipCounts = computed(() => {
})
const moveFolders = computed(() => folders.value.filter(folder => folder.id !== folderId.value))
const focused = computed(() => entries.value.find(entry => entry.key === focusedKey.value) || null)
const focusedStill = computed(() => {
if (focused.value?.kind !== 'still' || !focused.value.stillGroup) return null
return focused.value.stillGroup.parts.find(part => part.id === focusedPartId.value) || focused.value.stillGroup.head
})
const focusedStillRole = computed(() => focusedStill.value?.role === 'input' ? 'input' : (focusedStill.value ? (focusedStill.value.role || 'output') : ''))
const emptyLabel = computed(() => {
if (search.value.trim()) return 'Nothing matches that search.'
if (filter.value === 'images') return 'No generated stills here yet.'
@@ -716,6 +729,20 @@ function useInStudio(entry: LibraryEntry) {
}
}
async function saveFocusedAsInput() {
const still = focusedStill.value
if (!still || keepingInputBusy.value) return
keepingInputBusy.value = true
try {
applyLibrary(await $fetch(`/api/library/stills/${still.id}/keep-input`, { method: 'POST' }))
toast('Saved to Input. Pick it later from Choose an image → Input.')
} catch (error: any) {
toast(error?.data?.statusMessage || 'Could not save that still as input')
} finally {
keepingInputBusy.value = false
}
}
function startRename() {
if (!focused.value) return
renaming.value = true