Skip to content

Commit f76eae3

Browse files
committed
Add subgraph nodes to before/after exec
1 parent 9776513 commit f76eae3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/scripts/app.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,9 @@ export class ComfyApp {
12381238
// Allow widgets to run callbacks before a prompt has been queued
12391239
// e.g. random seed before every gen
12401240
executeWidgetsCallback(this.graph.nodes, 'beforeQueued')
1241+
for (const subgraph of this.graph.subgraphs.values()) {
1242+
executeWidgetsCallback(subgraph.nodes, 'beforeQueued')
1243+
}
12411244

12421245
const p = await this.graphToPrompt(this.graph, { queueNodeIds })
12431246
try {
@@ -1283,6 +1286,10 @@ export class ComfyApp {
12831286
.filter((n) => !!n),
12841287
'afterQueued'
12851288
)
1289+
for (const subgraph of this.graph.subgraphs.values()) {
1290+
executeWidgetsCallback(subgraph.nodes, 'afterQueued')
1291+
}
1292+
12861293
this.canvas.draw(true, true)
12871294
await this.ui.queue.update()
12881295
}

0 commit comments

Comments
 (0)