From 6e5930c3552384fba6d5e3f6f00ca64d2bafd428 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Tue, 22 Apr 2025 05:24:48 +1000 Subject: [PATCH] [API] Add sockets to custom widgets by default (#3548) --- src/services/litegraphService.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/litegraphService.ts b/src/services/litegraphService.ts index c274f67af..8cb6a5b4a 100644 --- a/src/services/litegraphService.ts +++ b/src/services/litegraphService.ts @@ -41,7 +41,6 @@ import { import { useExtensionService } from './extensionService' -const PRIMITIVE_TYPES = new Set(['INT', 'FLOAT', 'BOOLEAN', 'STRING', 'COMBO']) export const CONFIG = Symbol() export const GET_CONFIG = Symbol() @@ -124,7 +123,8 @@ export const useLitegraphService = () => { } /** - * @internal Add a widget to the node. For primitive types, an input socket is also added. + * @internal Add a widget to the node. For both primitive types and custom widgets + * (unless `socketless`), an input socket is also added. */ #addInputWidget(inputSpec: InputSpec) { const inputName = inputSpec.name @@ -152,7 +152,7 @@ export const useLitegraphService = () => { }) } - if (PRIMITIVE_TYPES.has(inputSpec.type)) { + if (!widget?.options?.socketless) { const inputSpecV1 = transformInputSpecV2ToV1(inputSpec) this.addInput(inputName, inputSpec.type, { shape: inputSpec.isOptional ? RenderShape.HollowCircle : undefined,