diff --git a/browser_tests/copyPaste.spec.ts-snapshots/copied-node-chromium-linux.png b/browser_tests/copyPaste.spec.ts-snapshots/copied-node-chromium-linux.png index 5501865d0..33b55ae7d 100644 Binary files a/browser_tests/copyPaste.spec.ts-snapshots/copied-node-chromium-linux.png and b/browser_tests/copyPaste.spec.ts-snapshots/copied-node-chromium-linux.png differ diff --git a/browser_tests/copyPaste.spec.ts-snapshots/no-node-copied-chromium-linux.png b/browser_tests/copyPaste.spec.ts-snapshots/no-node-copied-chromium-linux.png index 9d7a7ffaf..2e134d053 100644 Binary files a/browser_tests/copyPaste.spec.ts-snapshots/no-node-copied-chromium-linux.png and b/browser_tests/copyPaste.spec.ts-snapshots/no-node-copied-chromium-linux.png differ diff --git a/browser_tests/copyPaste.spec.ts-snapshots/paste-in-text-area-with-node-previously-copied-chromium-linux.png b/browser_tests/copyPaste.spec.ts-snapshots/paste-in-text-area-with-node-previously-copied-chromium-linux.png index fdc5a59fe..388aa2972 100644 Binary files a/browser_tests/copyPaste.spec.ts-snapshots/paste-in-text-area-with-node-previously-copied-chromium-linux.png and b/browser_tests/copyPaste.spec.ts-snapshots/paste-in-text-area-with-node-previously-copied-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/adjusted-widget-value-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/adjusted-widget-value-chromium-linux.png index 8ed396024..b1b8a1efe 100644 Binary files a/browser_tests/interaction.spec.ts-snapshots/adjusted-widget-value-chromium-linux.png and b/browser_tests/interaction.spec.ts-snapshots/adjusted-widget-value-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/default-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/default-chromium-linux.png index f6d7b3540..2e134d053 100644 Binary files a/browser_tests/interaction.spec.ts-snapshots/default-chromium-linux.png and b/browser_tests/interaction.spec.ts-snapshots/default-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/disconnected-edge-with-menu-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/disconnected-edge-with-menu-chromium-linux.png index ebd206737..0f90acd57 100644 Binary files a/browser_tests/interaction.spec.ts-snapshots/disconnected-edge-with-menu-chromium-linux.png and b/browser_tests/interaction.spec.ts-snapshots/disconnected-edge-with-menu-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/panned-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/panned-chromium-linux.png index 866d7d447..83deac9d7 100644 Binary files a/browser_tests/interaction.spec.ts-snapshots/panned-chromium-linux.png and b/browser_tests/interaction.spec.ts-snapshots/panned-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/selected-node1-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/selected-node1-chromium-linux.png index b9882de6f..a7dec06e6 100644 Binary files a/browser_tests/interaction.spec.ts-snapshots/selected-node1-chromium-linux.png and b/browser_tests/interaction.spec.ts-snapshots/selected-node1-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/zoomed-in-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/zoomed-in-chromium-linux.png index b0edeba61..944d42014 100644 Binary files a/browser_tests/interaction.spec.ts-snapshots/zoomed-in-chromium-linux.png and b/browser_tests/interaction.spec.ts-snapshots/zoomed-in-chromium-linux.png differ diff --git a/browser_tests/interaction.spec.ts-snapshots/zoomed-out-chromium-linux.png b/browser_tests/interaction.spec.ts-snapshots/zoomed-out-chromium-linux.png index f6d7b3540..2e134d053 100644 Binary files a/browser_tests/interaction.spec.ts-snapshots/zoomed-out-chromium-linux.png and b/browser_tests/interaction.spec.ts-snapshots/zoomed-out-chromium-linux.png differ diff --git a/browser_tests/nodeSearchBox.spec.ts-snapshots/added-node-chromium-linux.png b/browser_tests/nodeSearchBox.spec.ts-snapshots/added-node-chromium-linux.png index 1cb4325b9..aed0ae8f4 100644 Binary files a/browser_tests/nodeSearchBox.spec.ts-snapshots/added-node-chromium-linux.png and b/browser_tests/nodeSearchBox.spec.ts-snapshots/added-node-chromium-linux.png differ diff --git a/browser_tests/nodeSearchBox.spec.ts-snapshots/auto-linked-node-chromium-linux.png b/browser_tests/nodeSearchBox.spec.ts-snapshots/auto-linked-node-chromium-linux.png index a0dfeb37d..0549b9621 100644 Binary files a/browser_tests/nodeSearchBox.spec.ts-snapshots/auto-linked-node-chromium-linux.png and b/browser_tests/nodeSearchBox.spec.ts-snapshots/auto-linked-node-chromium-linux.png differ diff --git a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-bypassed-chromium-linux.png b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-bypassed-chromium-linux.png index 39eb634d3..12eda99f3 100644 Binary files a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-bypassed-chromium-linux.png and b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-bypassed-chromium-linux.png differ diff --git a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-chromium-linux.png b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-chromium-linux.png index b3166d65b..dc8e04567 100644 Binary files a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-chromium-linux.png and b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-chromium-linux.png differ diff --git a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-collapsed-chromium-linux.png b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-collapsed-chromium-linux.png index 4195bed25..890932e8c 100644 Binary files a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-collapsed-chromium-linux.png and b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-collapsed-chromium-linux.png differ diff --git a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-widget-converted-chromium-linux.png b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-widget-converted-chromium-linux.png index 69f637488..13842e6af 100644 Binary files a/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-widget-converted-chromium-linux.png and b/browser_tests/rightClickMenu.spec.ts-snapshots/right-click-node-widget-converted-chromium-linux.png differ diff --git a/browser_tests/rightClickMenu.spec.ts-snapshots/selected-2-nodes-chromium-linux.png b/browser_tests/rightClickMenu.spec.ts-snapshots/selected-2-nodes-chromium-linux.png index b6bdfae42..599c8a93c 100644 Binary files a/browser_tests/rightClickMenu.spec.ts-snapshots/selected-2-nodes-chromium-linux.png and b/browser_tests/rightClickMenu.spec.ts-snapshots/selected-2-nodes-chromium-linux.png differ diff --git a/package-lock.json b/package-lock.json index 8c494d924..9e0bd1407 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "comfyui-frontend", "version": "1.1.7", "dependencies": { - "@comfyorg/litegraph": "^0.7.25", + "@comfyorg/litegraph": "^0.7.26", "@primevue/themes": "^4.0.0-rc.2", "@vitejs/plugin-vue": "^5.0.5", "dotenv": "^16.4.5", @@ -1815,9 +1815,9 @@ "dev": true }, "node_modules/@comfyorg/litegraph": { - "version": "0.7.25", - "resolved": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.7.25.tgz", - "integrity": "sha512-/Zk9lT0Cq17IFrlntZ8fKmiH6CpMXaEmAdWHdWtaiCDybNFAqCpr7w0JDjax0dR4pjYqHSAPtHUSjLvD+5q8Kw==" + "version": "0.7.26", + "resolved": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.7.26.tgz", + "integrity": "sha512-o62S4tvHXfcAlnyG4UaAuoMyjB+g2nauQ3+l0HWwJjdj6KA565du6PX4OdL5DE0YW1iRNtFEoNq5IQITq26tow==" }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", diff --git a/package.json b/package.json index c95c2bb8a..57ca76345 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "zip-dir": "^2.0.0" }, "dependencies": { - "@comfyorg/litegraph": "^0.7.25", + "@comfyorg/litegraph": "^0.7.26", "@primevue/themes": "^4.0.0-rc.2", "@vitejs/plugin-vue": "^5.0.5", "dotenv": "^16.4.5", diff --git a/tests-ui/tests/litegraph.test.ts b/tests-ui/tests/litegraph.test.ts new file mode 100644 index 000000000..6f075a127 --- /dev/null +++ b/tests-ui/tests/litegraph.test.ts @@ -0,0 +1,40 @@ +import { LiteGraph } from "@comfyorg/litegraph"; +import { LGraph } from "@comfyorg/litegraph"; +import { LGraphNode } from "@comfyorg/litegraph"; + +function swapNodes(nodes: LGraphNode[]) { + const firstNode = nodes[0]; + const lastNode = nodes[nodes.length - 1]; + nodes[0] = lastNode; + nodes[nodes.length - 1] = firstNode; + return nodes; +} + +function createGraph(...nodes: LGraphNode[]) { + const graph = new LGraph(); + nodes.forEach((node) => graph.add(node)); + return graph; +} + +class DummyNode extends LGraphNode { + constructor() { + super(); + } +} + +describe("LGraph", () => { + it("should serialize deterministic node order", async () => { + LiteGraph.registerNodeType("dummy", DummyNode); + const node1 = new DummyNode(); + const node2 = new DummyNode(); + const graph = createGraph(node1, node2); + + const result1 = graph.serialize(); + expect(result1.nodes).not.toHaveLength(0); + // @ts-ignore + graph._nodes = swapNodes(graph._nodes); + const result2 = graph.serialize(); + + expect(result1).toEqual(result2); + }); +});