Keep extension chains alive and save each finished segment.

The overall bar made a long queue look stuck at ~9% during the first clip, and nothing was written until the last step. Save checkpoints, use per-step progress, and stop treating a short Comfy history lag as a dropped job.
This commit is contained in:
2026-08-26 02:21:55 -05:00
parent f6feb41d62
commit d78c3fee7d
6 changed files with 78 additions and 30 deletions
+8 -6
View File
@@ -209,25 +209,27 @@ export async function isComfyPromptDropped(promptId: string) {
if (queue.running > 0 || queue.pending > 0) return false
const history = await fetchHistory(promptId)
const entry = history?.[promptId] as { status?: { status_str?: string; completed?: boolean } } | undefined
if (!entry) return true
if (!entry) return false
const inspected = inspectHistory(history, promptId)
if (inspected.video) return false
const status = entry.status?.status_str
if (status === 'error' || status === 'interrupted') return true
if (entry.status?.completed) return true
return true
return false
}
export function inspectHistory(history: Record<string, unknown> | null, promptId: string) {
const video = extractVideo(history, promptId)
if (video) return { video, completed: true, error: null as string | null }
if (!history) return { video: null, completed: false, error: null as string | null }
const entry = (history[promptId] || history) as {
status?: { status_str?: string; completed?: boolean }
}
const error = entry?.status?.status_str === 'error' || entry?.status?.status_str === 'interrupted'
? (entry.status.status_str === 'interrupted' ? 'Job interrupted.' : 'ComfyUI reported an execution error')
: null
return { video, completed: Boolean(video), error }
const status = entry?.status?.status_str
if (status === 'interrupted') return { video: null, completed: false, error: 'Job interrupted.' }
if (status === 'error') return { video: null, completed: false, error: 'ComfyUI reported an execution error' }
if (entry?.status?.completed) return { video: null, completed: true, error: 'ComfyUI finished without an MP4' }
return { video: null, completed: false, error: null as string | null }
}
export async function probeComfy() {