Fix generation progress getting stuck at 1% after Comfy finishes.

Poll Comfy history and the job snapshot so the browser still gets the video when the live stream is buffered or the websocket misses completion.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-25 18:23:23 -05:00
co-authored by Cursor
parent ca51fddea3
commit c4e6af9f77
8 changed files with 326 additions and 182 deletions
+3 -1
View File
@@ -95,9 +95,11 @@ async function runGeneration(
length: number
}
) {
const done = watchComfyJob(job)
job.status = 'uploading'
const uploaded = await uploadImage(params.image)
emitJob(job, { type: 'status', message: 'Queueing MiniMax H3 job...', progress: 6 })
await waitForComfySocket(job, 4000)
const graph = buildWorkflow({
prompt: params.prompt,
@@ -114,5 +116,5 @@ async function runGeneration(
job.promptId = queued.prompt_id
job.status = 'running'
emitJob(job, { type: 'status', message: 'Job queued on ComfyUI', progress: 8 })
await watchComfyJob(job)
await done
}