Move label loading into autogrow code

This commit is contained in:
Austin Mroz
2026-03-28 13:47:52 -07:00
parent cd33b16061
commit 2c523ba2c8
2 changed files with 14 additions and 15 deletions

View File

@@ -572,6 +572,20 @@ function withComfyAutogrow(node: LGraphNode): asserts node is AutogrowNode {
}
}
)
// Restore renamed labels after configure (autogrow recreates inputs fresh)
node.onConfigure = useChainCallback(
node.onConfigure,
(data: { inputs?: Array<{ label?: string; name: string }> }) => {
if (!data?.inputs) return
for (const serializedInput of data.inputs) {
if (!serializedInput.label) continue
const match = node.inputs.find(
(inp) => inp.name === serializedInput.name
)
if (match) match.label = serializedInput.label
}
}
)
}
function applyAutogrow(node: LGraphNode, inputSpecV2: InputSpecV2) {
withComfyAutogrow(node)

View File

@@ -158,21 +158,6 @@ function onBranchSelectorCreated(this: LGraphNode) {
this.onConnectionsChange,
() => connectionsTrigger.value++
)
// Restore renamed labels after configure (autogrow recreates inputs fresh)
this.onConfigure = useChainCallback(
this.onConfigure,
(data: { inputs?: Array<{ label?: string; name: string }> }) => {
if (!data?.inputs) return
for (const serializedInput of data.inputs) {
if (!serializedInput.label) continue
const match = node.inputs.find(
(inp) => inp.name === serializedInput.name
)
if (match) match.label = serializedInput.label
}
}
)
}
function onCustomIntCreated(this: LGraphNode) {