[Refactor] Move Widget.beforeQueued invocation from graphToPrompt to queuePrompt (#2667)

This commit is contained in:
Chenlei Hu
2025-02-21 14:18:11 -05:00
committed by GitHub
parent 40deb19634
commit 40da43861e
3 changed files with 23 additions and 24 deletions

View File

@@ -42,3 +42,14 @@ export const getItemsColorOption = (items: unknown[]): ColorOption | null => {
? _.head(colorOptions)!
: null
}
export function executeWidgetsCallback(
nodes: LGraphNode[],
callbackName: 'onRemove' | 'beforeQueued' | 'afterQueued'
) {
for (const node of nodes) {
for (const widget of node.widgets ?? []) {
widget[callbackName]?.()
}
}
}