diff --git a/src/scripts/app.ts b/src/scripts/app.ts index 9474c124c..5f5055a92 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -1246,6 +1246,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 { @@ -1291,6 +1294,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() }