Restore Use as input to reload full generation settings.

The earlier change blocked generate stills and skipped prompts/LoRAs/config. Use as input again fills the form from the library item so you can regenerate.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-04 00:06:15 -05:00
co-authored by Cursor
parent 249af0b7b8
commit 936da7b5de
2 changed files with 36 additions and 23 deletions
+29 -22
View File
@@ -4394,7 +4394,6 @@ async function applyIncomingLibraryItem() {
const clipId = String(route.query.clip || '').trim()
const stillId = String(route.query.still || '').trim()
const use = String(route.query.use || '') === '1'
const studio = String(route.query.studio || '').toLowerCase()
if (clipId) {
const clip = clips.value.find(item => item.id === clipId)
if (clip) {
@@ -4404,14 +4403,8 @@ async function applyIncomingLibraryItem() {
} else if (stillId) {
const still = stills.value.find(item => item.id === stillId)
if (still) {
if (use) {
await useStillAsInput(still)
// Prefer Video for "use as input" unless the link explicitly asked for Image.
if (studio === 'image') selectStudioKind('image')
else selectStudioKind('video')
} else {
openStill(still)
}
if (use) await useStillAsInput(still)
else openStill(still)
}
}
void router.replace({ path: '/', query: {} })
@@ -6278,24 +6271,38 @@ async function loadStillAsEditRef(stillId: string) {
setEditRef(new File([blob], stillFileName(still) || 'still-b.png', { type: blob.type || 'image/png' }))
}
function stillUseAsInputMessage(_still: LibraryStill) {
return 'Loaded as input. Switch to Image only if you want to edit it there.'
function stillUseAsInputMessage(still: LibraryStill) {
const dest = inferStillPipeline(still)
const mode = still.settings?.mode
if (dest === 'imagev2' && mode === 'generate') return 'Generate settings loaded. Tweak and generate.'
if (dest === 'imagev2' && mode === 'compose') {
return still.settings?.referenceStillId
? 'Compose settings loaded. Tweak and generate.'
: 'Compose settings loaded. Re-add still B, then generate.'
}
if (dest === 'imagev2' && mode === 'refine') return 'Refine settings loaded. Paint a mask, then generate.'
if (dest === 'imagev2') return 'Image v2 settings loaded. Tweak and generate.'
if (dest === 'image' && still.settings) return 'Image edit settings loaded. Tweak and generate.'
return 'Loaded as input. It stays in Output, not the upload library.'
}
async function useStillAsInput(still: LibraryStill) {
try {
// Use as input = put pixels in the start-still slot. Do NOT jump to Image studio
// or overwrite video settings — that trapped people on the Image tab.
folderId.value = still.folderId
browseFolderId.value = still.folderId
const generateOnly = inferStillPipeline(still) === 'imagev2' && still.settings?.mode === 'generate'
if (generateOnly) {
toast('That still is text-to-image only (no canvas to reuse). Pick a different image.')
return
applyStillSettings(still)
const dest = inferStillPipeline(still)
const generate = dest === 'imagev2' && still.settings?.mode === 'generate'
if (!generate) {
const blob = await $fetch<Blob>(`/api/library/stills/${still.id}`, { responseType: 'blob' })
if (still.hideInput && showPrivacyToggles.value) hideInputPreview.value = true
readFile(new File([blob], stillFileName(still), { type: blob.type || 'image/png' }), { stillId: still.id })
}
if (dest === 'imagev2' && still.settings?.mode === 'compose' && still.settings.referenceStillId) {
try {
await loadStillAsEditRef(still.settings.referenceStillId)
} catch {
toast('Compose settings loaded, but still B is missing. Re-add it.')
}
}
const blob = await $fetch<Blob>(`/api/library/stills/${still.id}`, { responseType: 'blob' })
if (still.hideInput && showPrivacyToggles.value) hideInputPreview.value = true
readFile(new File([blob], stillFileName(still), { type: blob.type || 'image/png' }), { stillId: still.id })
scrollToStudioInput()
toast(stillUseAsInputMessage(still))
} catch (error: any) {
+7 -1
View File
@@ -1058,7 +1058,13 @@ function useInStudio(entry: LibraryEntry) {
return
}
if (entry.stillGroup) {
navigateTo({ path: '/', query: { still: focusedPartId.value || entry.stillGroup.head.id, use: '1', studio: 'video' } })
const stillId = focusedPartId.value || entry.stillGroup.head.id
const still = stills.value.find(item => item.id === stillId) || entry.stillGroup.head
const imageStill = Boolean(still?.settings?.kind === 'imagev2' || still?.settings?.kind === 'image' || still?.settings?.mode)
navigateTo({
path: '/',
query: { still: stillId, use: '1', studio: imageStill ? 'image' : 'video' }
})
}
}