mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
Move label loading into autogrow code
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user