From 9d41993ae8e096b8821f0ef3bd67665f8654cd01 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Wed, 8 Nov 2023 21:05:06 +0000 Subject: [PATCH] Resolve issue with sanitized node name --- tests-ui/tests/groupNode.test.js | 2 +- tests-ui/tests/widgetInputs.test.js | 4 ++-- web/scripts/app.js | 13 +++++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/tests-ui/tests/groupNode.test.js b/tests-ui/tests/groupNode.test.js index ce6342267..109eeb8b5 100644 --- a/tests-ui/tests/groupNode.test.js +++ b/tests-ui/tests/groupNode.test.js @@ -543,7 +543,7 @@ describe("group node", () => { }); expect(dialogShow).toBeCalledTimes(1); - const call = dialogShow.mock.calls[0][0]; + const call = dialogShow.mock.calls[0][0].innerHTML; expect(call).toContain("the following node types were not found"); expect(call).toContain("NotKSampler"); expect(call).toContain("NotVAEDecode"); diff --git a/tests-ui/tests/widgetInputs.test.js b/tests-ui/tests/widgetInputs.test.js index 022e54926..5b0dd97f4 100644 --- a/tests-ui/tests/widgetInputs.test.js +++ b/tests-ui/tests/widgetInputs.test.js @@ -198,8 +198,8 @@ describe("widget inputs", () => { }); expect(dialogShow).toBeCalledTimes(1); - expect(dialogShow.mock.calls[0][0]).toContain("the following node types were not found"); - expect(dialogShow.mock.calls[0][0]).toContain("TestNode"); + expect(dialogShow.mock.calls[0][0].innerHTML).toContain("the following node types were not found"); + expect(dialogShow.mock.calls[0][0].innerHTML).toContain("TestNode"); }); test("defaultInput widgets can be converted back to inputs", async () => { diff --git a/web/scripts/app.js b/web/scripts/app.js index b2801e409..7d744f486 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -1511,8 +1511,8 @@ export class ComfyApp { // Find missing node types if (!(n.type in LiteGraph.registered_node_types)) { - n.type = sanitizeNodeName(n.type); missingNodeTypes.push(n.type); + n.type = sanitizeNodeName(n.type); } } @@ -1603,9 +1603,14 @@ export class ComfyApp { if (missingNodeTypes.length) { this.ui.dialog.show( - `When loading the graph, the following node types were not found: Nodes that have failed to load will show as red on the graph.` + $el("div", [ + $el("span", { textContent: "When loading the graph, the following node types were not found: " }), + $el( + "ul", + Array.from(new Set(missingNodeTypes)).map((t) => $el("li", { textContent: t })) + ), + $el("span", { textContent: "Nodes that have failed to load will show as red on the graph." }), + ]) ); this.logging.addEntry("Comfy.App", "warn", { MissingNodes: missingNodeTypes,