Notify from the installed web app when a generation finishes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-01 07:11:12 -05:00
co-authored by Cursor
parent fa32fb0a8e
commit 2635b8838c
7 changed files with 195 additions and 2 deletions
+7
View File
@@ -5743,6 +5743,7 @@ async function generateExtension() {
statusMessage.value = 'Extracting last frame & stitching extension...'
startTimer('video')
try {
await ensureGenerationNotifyPermission()
const started = await $fetch<{ jobId: string; steps: number; hideThumbnail?: boolean; folderLocked?: boolean }>('/api/extend', {
method: 'POST',
body: {
@@ -6463,6 +6464,7 @@ async function editImage() {
const extraPasses = editPassQueue.value.map(item => ({ prompt: item.prompt.trim() }))
const hideOut = hideThumbnail.value
try {
await ensureGenerationNotifyPermission()
const body = new FormData()
body.append('image', file.value)
if (editRefFile.value) body.append('image2', editRefFile.value)
@@ -6679,6 +6681,7 @@ async function editImageV2() {
const extraPasses = v2PassChaining.value ? editPassQueue.value.map(item => ({ prompt: item.prompt.trim() })) : []
const hideOut = hideThumbnail.value
try {
await ensureGenerationNotifyPermission()
const body = new FormData()
body.append('mode', v2Mode.value)
body.append('task', v2Mode.value === 'generate' ? 't2i' : v2Mode.value === 'refine' ? 'refine' : v2Mode.value === 'compose' ? v2Task.value : 'scene')
@@ -6900,6 +6903,7 @@ async function generate() {
const hideOut = hideThumbnail.value
const folderLockedPref = false
try {
await ensureGenerationNotifyPermission()
const body = new FormData()
if (file.value) body.append('image', file.value)
if (inputStillId.value) body.append('stillId', inputStillId.value)
@@ -7132,6 +7136,7 @@ function applyEditEvent(payload: Record<string, any>, hidden: boolean, folderLoc
scheduleLibraryRefresh()
void pollComfyHealth()
void refreshStudioQueue()
void notifyGenerationComplete('image')
return
}
@@ -7246,6 +7251,7 @@ function applyVideoEvent(payload: Record<string, any>, hidden: boolean, folderLo
toast(locked
? 'Saved to the locked folder. Unlock it to view.'
: 'New clip saved to the library')
void notifyGenerationComplete('video')
return
}
if (locked) {
@@ -7277,6 +7283,7 @@ function applyVideoEvent(payload: Record<string, any>, hidden: boolean, folderLo
scheduleLibraryRefresh()
void pollComfyHealth()
void refreshStudioQueue()
void notifyGenerationComplete('video')
return
}