Resolve issue with sanitized node name

This commit is contained in:
pythongosssss 2023-11-08 21:05:06 +00:00
parent d0514b87bc
commit 9d41993ae8
3 changed files with 12 additions and 7 deletions

View File

@ -543,7 +543,7 @@ describe("group node", () => {
}); });
expect(dialogShow).toBeCalledTimes(1); 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("the following node types were not found");
expect(call).toContain("NotKSampler"); expect(call).toContain("NotKSampler");
expect(call).toContain("NotVAEDecode"); expect(call).toContain("NotVAEDecode");

View File

@ -198,8 +198,8 @@ describe("widget inputs", () => {
}); });
expect(dialogShow).toBeCalledTimes(1); expect(dialogShow).toBeCalledTimes(1);
expect(dialogShow.mock.calls[0][0]).toContain("the following node types were not found"); expect(dialogShow.mock.calls[0][0].innerHTML).toContain("the following node types were not found");
expect(dialogShow.mock.calls[0][0]).toContain("TestNode"); expect(dialogShow.mock.calls[0][0].innerHTML).toContain("TestNode");
}); });
test("defaultInput widgets can be converted back to inputs", async () => { test("defaultInput widgets can be converted back to inputs", async () => {

View File

@ -1511,8 +1511,8 @@ export class ComfyApp {
// Find missing node types // Find missing node types
if (!(n.type in LiteGraph.registered_node_types)) { if (!(n.type in LiteGraph.registered_node_types)) {
n.type = sanitizeNodeName(n.type);
missingNodeTypes.push(n.type); missingNodeTypes.push(n.type);
n.type = sanitizeNodeName(n.type);
} }
} }
@ -1603,9 +1603,14 @@ export class ComfyApp {
if (missingNodeTypes.length) { if (missingNodeTypes.length) {
this.ui.dialog.show( this.ui.dialog.show(
`When loading the graph, the following node types were not found: <ul>${Array.from(new Set(missingNodeTypes)).map( $el("div", [
(t) => `<li>${t}</li>` $el("span", { textContent: "When loading the graph, the following node types were not found: " }),
).join("")}</ul>Nodes that have failed to load will show as red on the graph.` $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", { this.logging.addEntry("Comfy.App", "warn", {
MissingNodes: missingNodeTypes, MissingNodes: missingNodeTypes,