diff --git a/invokeai/frontend/web/src/features/nodes/util/node/nodeUpdate.ts b/invokeai/frontend/web/src/features/nodes/util/node/nodeUpdate.ts index 1851698374..fddd925f02 100644 --- a/invokeai/frontend/web/src/features/nodes/util/node/nodeUpdate.ts +++ b/invokeai/frontend/web/src/features/nodes/util/node/nodeUpdate.ts @@ -34,7 +34,9 @@ const getMayUpdateNode = (node: InvocationNode, template: InvocationTemplate): b * - Create a new node data object with the latest version of the template. * - Recursively merge new node data object into the node to be updated. * - * @param node The node to updated. + * The input node is not mutated; a new object is returned. + * + * @param node The node to be updated. * @param template The invocation template to update to. * @throws {NodeUpdateError} If the node is not an invocation node. */ diff --git a/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.ts b/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.ts index 0b4873467c..f80f8b6eae 100644 --- a/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.ts +++ b/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.ts @@ -71,7 +71,7 @@ export const validateWorkflow = async ( const { nodes, edges } = _workflow; const warnings: WorkflowWarning[] = []; - for (const [i, node] of nodes.entries()) { + for (const node of nodes) { if (!isWorkflowInvocationNode(node)) { // We don't need to validate Note nodes or CurrentImage nodes - only Invocation nodes continue; @@ -94,7 +94,7 @@ export const validateWorkflow = async ( if (getNeedsUpdate(node.data, template)) { try { const updatedNode = updateNode(node, template); - nodes[i] = updatedNode; + node.data = updatedNode.data; } catch (e) { const message = t('nodes.unableToUpdateNode', { node: node.id,