From f76eae338327cf813f91e0dd8ef3a88ef78a8158 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Thu, 22 May 2025 11:35:10 -0700 Subject: [PATCH] Add subgraph nodes to before/after exec --- src/scripts/app.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/scripts/app.ts b/src/scripts/app.ts index d1e2d6e87..ea3b5bccc 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -1238,6 +1238,9 @@ export class ComfyApp { // Allow widgets to run callbacks before a prompt has been queued // e.g. random seed before every gen executeWidgetsCallback(this.graph.nodes, 'beforeQueued') + for (const subgraph of this.graph.subgraphs.values()) { + executeWidgetsCallback(subgraph.nodes, 'beforeQueued') + } const p = await this.graphToPrompt(this.graph, { queueNodeIds }) try { @@ -1283,6 +1286,10 @@ export class ComfyApp { .filter((n) => !!n), 'afterQueued' ) + for (const subgraph of this.graph.subgraphs.values()) { + executeWidgetsCallback(subgraph.nodes, 'afterQueued') + } + this.canvas.draw(true, true) await this.ui.queue.update() }