diff --git a/src/scripts/app.ts b/src/scripts/app.ts index 3db03cc39..1e9df767e 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -63,6 +63,7 @@ import { ExtensionManager } from '@/types/extensionTypes' import type { NodeExecutionId } from '@/types/nodeIdentification' import { ColorAdjustOptions, adjustColor } from '@/utils/colorUtil' import { graphToPrompt } from '@/utils/executionUtil' +import { forEachNode } from '@/utils/graphTraversalUtil' import { getNodeByExecutionId, triggerCallbackOnAllNodes @@ -1700,12 +1701,13 @@ export class ComfyApp { for (const nodeId in defs) { this.registerNodeDef(nodeId, defs[nodeId]) } - for (const node of this.graph.nodes) { + // Refresh combo widgets in all nodes including those in subgraphs + forEachNode(this.graph, (node) => { const def = defs[node.type] // Allow primitive nodes to handle refresh node.refreshComboInNode?.(defs) - if (!def?.input) continue + if (!def?.input) return if (node.widgets) { const nodeInputs = def.input @@ -1732,7 +1734,7 @@ export class ComfyApp { } } } - } + }) await useExtensionService().invokeExtensionsAsync( 'refreshComboInNodes',