From 6f8a91b0c1af97aa5fb200eb8e8b1339afa355ce Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Sun, 4 May 2025 09:13:37 +1000 Subject: [PATCH] Fix corruption when app.graph is changed --- src/scripts/app.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/scripts/app.ts b/src/scripts/app.ts index 132807471..c7532e568 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -715,20 +715,20 @@ export class ComfyApp { } #addAfterConfigureHandler() { - const app = this - const onConfigure = app.graph.onConfigure - app.graph.onConfigure = function (...args) { + const { graph } = this + const { onConfigure } = graph + graph.onConfigure = function (...args) { fixLinkInputSlots(this) // Fire callbacks before the onConfigure, this is used by widget inputs to setup the config - for (const node of app.graph.nodes) { + for (const node of graph.nodes) { node.onGraphConfigured?.() } const r = onConfigure?.apply(this, args) // Fire after onConfigure, used by primitives to generate widget using input nodes config - for (const node of app.graph.nodes) { + for (const node of graph.nodes) { node.onAfterGraphConfigured?.() }