From 3fbaeb1fb87bc76fe66fc687a33e1e14c71fc492 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Tue, 16 Jul 2024 22:40:25 -0400 Subject: [PATCH] Fix custom node def validation issue (#137) * Fix nodeDef.output undefined * fix2 * nit --- src/services/nodeSearchService.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/services/nodeSearchService.ts b/src/services/nodeSearchService.ts index cfa9abc87..58c7ed962 100644 --- a/src/services/nodeSearchService.ts +++ b/src/services/nodeSearchService.ts @@ -119,7 +119,14 @@ export class OutputTypeFilter extends NodeFilter { public readonly longInvokeSequence = "output"; public override getNodeOptions(node: ComfyNodeDef): string[] { - const outputs = node.output; + const outputs = node.output || []; + // "custom_nodes.was-node-suite-comfyui" + // has a custom node with an output that is not an array. + // https://github.com/WASasquatch/was-node-suite-comfyui/pull/440 + if (!(outputs instanceof Array)) { + console.error("Invalid output type", node); + return []; + } return outputs.map((output) => { return typeof output === "string" ? output : output[0]; });