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
+4 -1
View File
@@ -249,9 +249,12 @@ export async function concatMp4(part1Path: string, part2Path: string, outputPath
}
export async function stitchExtension(params: { part1Path: string; part2: Buffer; tmpDir: string }) {
const part2Path = join(params.tmpDir, 'part2.mp4')
const part2Path = join(params.tmpDir, `part2_${Date.now()}.mp4`)
const finalPath = join(params.tmpDir, 'final_stitched_video.mp4')
writeFileSync(part2Path, params.part2)
if (!existsSync(part2Path) || !params.part2.length) {
throw new Error('Extension segment was missing before stitch')
}
try {
await xfadeStitch(params.part1Path, part2Path, finalPath)
} catch (error) {