From d3b32a4dae72eec93b0c35e0fc1b62a1f37616e3 Mon Sep 17 00:00:00 2001 From: bonlime Date: Thu, 18 Jul 2024 13:43:14 +0300 Subject: [PATCH] Sort nodes before saving --- web/scripts/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/scripts/app.js b/web/scripts/app.js index 8b4478a32..74f528afd 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -2033,6 +2033,9 @@ export class ComfyApp { } const workflow = graph.serialize(); + // links are already sorted, but nodes are not + workflow["nodes"] = Object.values(workflow["nodes"]).sort((a, b) => a.id - b.id); + const output = {}; // Process nodes in order of execution for (const outerNode of graph.computeExecutionOrder(false)) {