The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Chains: a step waiting for a stopped step is stopped with it, not failed
Adarsh34150d65b7e5
diff --git a/src/server/generations.ts b/src/server/generations.tsindex 76fdf995..bc5af39e 100644--- a/src/server/generations.ts+++ b/src/server/generations.ts@@ -2288,6 +2288,15 @@ async function advanceDependents(): Promise<void> {// An optional input whose step failed is left out (Genjutsu's anchor frame): the step runs without it.const skipped = allSlots.flatMap((s, i) => (s.optional && broken(allDeps[i]) ? [i] : []));const failedDeps = allDeps.filter((d, i) => broken(d) && !skipped.includes(i));+ if (failedDeps.length && failedDeps.every((d) => d?.status === "canceled")) {+ // Every step it waited for was stopped (a person's Stop on that step, or on the whole run): this one is stopped with+ // it, never failed. Nothing went wrong, so no failure is logged, and its own hold and unused inputs go.+ if (markCanceled(r.id)) {+ dropHold(r.id);+ dropUnused(allIds);+ }+ continue;+ }if (failedDeps.length) {// The owner's line goes with the first step after the failure: a step whose earlier steps all stopped only because// theirs did (a frame-by-frame chain broken at frame 3) writes none of its own.diff --git a/tests/chain-fanout.test.ts b/tests/chain-fanout.test.tsindex 1429198c..0f712cbb 100644--- a/tests/chain-fanout.test.ts+++ b/tests/chain-fanout.test.ts@@ -208,12 +208,15 @@ describe("fan-out and fan-in in createPipeline", () => {for (const w of waiting) expect(await settle(w.id, 20_000)).toMatchObject({ status: "failed", error: "An earlier step didn't finish" });});- it("a person's Stop on a run makes a step already failed by the stop before it stopped, not failed", async () => {+ it("a step waiting for a stopped step is stopped with it, never failed; one waiting for a failed step fails", async () => {const hold = held();const next = gens.createGenerations({ feature: "t", modelId: "nano-banana-2", op: "edit", prompt: "Ink" }, { dependsOn: hold.id })[0];- // The Stop reaches the first step; the sweep fails the waiting one before the Stop reaches it too.+ const third = gens.createGenerations({ feature: "t", modelId: "nano-banana-2", op: "edit", prompt: "Ink" }, { dependsOn: next.id })[0];+ // The person stops the first step only (a video before its Fix faces): the steps after it are stopped too.db().prepare("UPDATE generations SET status = 'canceled', completed_at = ? WHERE id = ?").run(Date.now(), hold.id);- expect(await settle(next.id, 20_000)).toMatchObject({ status: "failed", error: "An earlier step didn't finish" });+ expect(await settle(next.id, 20_000)).toMatchObject({ status: "canceled", error: null });+ expect(await settle(third.id, 20_000)).toMatchObject({ status: "canceled", error: null });+ // A Stop that reaches it afterwards changes nothing.await gens.cancelGeneration(next.id);expect(row(next.id)).toMatchObject({ status: "canceled", error: null });// A step that failed because its input failed stays failed.