From 936da7b5de8a7d0f95720f5d322d4cfb97a08137 Mon Sep 17 00:00:00 2001 From: Towsty Date: Fri, 4 Sep 2026 00:06:15 -0500 Subject: [PATCH] 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 --- pages/index.vue | 51 +++++++++++++++++++++++++++-------------------- pages/library.vue | 8 +++++++- 2 files changed, 36 insertions(+), 23 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index a8d39c7..7189912 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -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(`/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(`/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) { diff --git a/pages/library.vue b/pages/library.vue index 220defe..5001197 100644 --- a/pages/library.vue +++ b/pages/library.vue @@ -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' } + }) } }