From e90fd96eee8ee8d8b8d7a3dd4a9473d6d9048590 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:40:38 +1000 Subject: [PATCH] fix(nodes): fix warning when using current image node --- .../src/features/nodes/util/buildWorkflow.ts | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/invokeai/frontend/web/src/features/nodes/util/buildWorkflow.ts b/invokeai/frontend/web/src/features/nodes/util/buildWorkflow.ts index 9a50a6a2fe..b0ade42a9f 100644 --- a/invokeai/frontend/web/src/features/nodes/util/buildWorkflow.ts +++ b/invokeai/frontend/web/src/features/nodes/util/buildWorkflow.ts @@ -12,17 +12,21 @@ export const buildWorkflow = (nodesState: NodesState): Workflow => { edges: [], }; - nodes.forEach((node) => { - const result = zWorkflowNode.safeParse(node); - if (!result.success) { - const { message } = fromZodError(result.error, { - prefix: 'Unable to parse node', - }); - logger('nodes').warn({ node: parseify(node) }, message); - return; - } - workflow.nodes.push(result.data); - }); + nodes + .filter((n) => + ['invocation', 'notes'].includes(n.type ?? '__UNKNOWN_NODE_TYPE__') + ) + .forEach((node) => { + const result = zWorkflowNode.safeParse(node); + if (!result.success) { + const { message } = fromZodError(result.error, { + prefix: 'Unable to parse node', + }); + logger('nodes').warn({ node: parseify(node) }, message); + return; + } + workflow.nodes.push(result.data); + }); edges.forEach((edge) => { const result = zWorkflowEdge.safeParse(edge);