diff --git a/src/schemas/nodeDefSchema.ts b/src/schemas/nodeDefSchema.ts index fd6943b96..f1a93dadb 100644 --- a/src/schemas/nodeDefSchema.ts +++ b/src/schemas/nodeDefSchema.ts @@ -27,6 +27,7 @@ export const zBaseInputOptions = z .object({ default: z.any().optional(), defaultInput: z.boolean().optional(), + display_name: z.string().optional(), forceInput: z.boolean().optional(), tooltip: z.string().optional(), socketless: z.boolean().optional(), diff --git a/src/services/litegraphService.ts b/src/services/litegraphService.ts index 85b30ce46..6ea083df2 100644 --- a/src/services/litegraphService.ts +++ b/src/services/litegraphService.ts @@ -95,10 +95,11 @@ export const useLitegraphService = () => { ) if (widgetConstructor && !inputSpec.forceInput) return - node.addInput(inputName, inputSpec.type, { + const input = node.addInput(inputName, inputSpec.type, { shape: inputSpec.isOptional ? RenderShape.HollowCircle : undefined, localized_name: st(nameKey, inputName) }) + input.label ??= inputSpec.display_name } /** * @internal Setup stroke styles for the node under various conditions. @@ -164,7 +165,10 @@ export const useLitegraphService = () => { ) ?? {} if (widget) { - widget.label = st(nameKey, widget.label ?? inputName) + widget.label = st( + nameKey, + widget.label ?? widgetInputSpec.display_name ?? inputName + ) widget.options ??= {} Object.assign(widget.options, { advanced: inputSpec.advanced,