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>
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 113 KiB |
|
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
8
package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
40
tests-ui/tests/litegraph.test.ts
Normal 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);
|
||||
});
|
||||
});
|
||||