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:
+27
-20
@@ -4394,7 +4394,6 @@ async function applyIncomingLibraryItem() {
|
|||||||
const clipId = String(route.query.clip || '').trim()
|
const clipId = String(route.query.clip || '').trim()
|
||||||
const stillId = String(route.query.still || '').trim()
|
const stillId = String(route.query.still || '').trim()
|
||||||
const use = String(route.query.use || '') === '1'
|
const use = String(route.query.use || '') === '1'
|
||||||
const studio = String(route.query.studio || '').toLowerCase()
|
|
||||||
if (clipId) {
|
if (clipId) {
|
||||||
const clip = clips.value.find(item => item.id === clipId)
|
const clip = clips.value.find(item => item.id === clipId)
|
||||||
if (clip) {
|
if (clip) {
|
||||||
@@ -4404,14 +4403,8 @@ async function applyIncomingLibraryItem() {
|
|||||||
} else if (stillId) {
|
} else if (stillId) {
|
||||||
const still = stills.value.find(item => item.id === stillId)
|
const still = stills.value.find(item => item.id === stillId)
|
||||||
if (still) {
|
if (still) {
|
||||||
if (use) {
|
if (use) await useStillAsInput(still)
|
||||||
await useStillAsInput(still)
|
else openStill(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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void router.replace({ path: '/', query: {} })
|
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' }))
|
setEditRef(new File([blob], stillFileName(still) || 'still-b.png', { type: blob.type || 'image/png' }))
|
||||||
}
|
}
|
||||||
|
|
||||||
function stillUseAsInputMessage(_still: LibraryStill) {
|
function stillUseAsInputMessage(still: LibraryStill) {
|
||||||
return 'Loaded as input. Switch to Image only if you want to edit it there.'
|
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) {
|
async function useStillAsInput(still: LibraryStill) {
|
||||||
try {
|
try {
|
||||||
// Use as input = put pixels in the start-still slot. Do NOT jump to Image studio
|
applyStillSettings(still)
|
||||||
// or overwrite video settings — that trapped people on the Image tab.
|
const dest = inferStillPipeline(still)
|
||||||
folderId.value = still.folderId
|
const generate = dest === 'imagev2' && still.settings?.mode === 'generate'
|
||||||
browseFolderId.value = still.folderId
|
if (!generate) {
|
||||||
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
|
|
||||||
}
|
|
||||||
const blob = await $fetch<Blob>(`/api/library/stills/${still.id}`, { responseType: 'blob' })
|
const blob = await $fetch<Blob>(`/api/library/stills/${still.id}`, { responseType: 'blob' })
|
||||||
if (still.hideInput && showPrivacyToggles.value) hideInputPreview.value = true
|
if (still.hideInput && showPrivacyToggles.value) hideInputPreview.value = true
|
||||||
readFile(new File([blob], stillFileName(still), { type: blob.type || 'image/png' }), { stillId: still.id })
|
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.')
|
||||||
|
}
|
||||||
|
}
|
||||||
scrollToStudioInput()
|
scrollToStudioInput()
|
||||||
toast(stillUseAsInputMessage(still))
|
toast(stillUseAsInputMessage(still))
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
|
|||||||
+7
-1
@@ -1058,7 +1058,13 @@ function useInStudio(entry: LibraryEntry) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (entry.stillGroup) {
|
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' }
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user