From f2bc74f0b77713c020333abcfeaef6e126329cc7 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 7db32e9e0..acea32fae 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -704,20 +704,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?.() }