Update litegraph to 0.7.26 (#161)

* Update litegraph

* Test node order

* Update test expectations [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-07-18 17:34:35 -04:00
committed by GitHub
parent 9961be1bc7
commit ab7436f87c
20 changed files with 45 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

8
package-lock.json generated
View File

@@ -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",

View File

@@ -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",

View File

@@ -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);
});
});