Type INodeOutputSlot widget hack on PrimitiveNode (#2728)

This commit is contained in:
Chenlei Hu
2025-02-25 19:34:23 -05:00
committed by GitHub
parent c20ea0c523
commit a784abef0d
2 changed files with 11 additions and 3 deletions

View File

@@ -1,12 +1,12 @@
// @ts-strict-ignore
import { LGraphNode, LiteGraph } from '@comfyorg/litegraph'
import type {
IFoundSlot,
INodeInputSlot,
INodeOutputSlot,
IWidget,
LiteGraphCanvasEvent
} from '@comfyorg/litegraph'
import type { IFoundSlot } from '@comfyorg/litegraph'
import { INodeSlot } from '@comfyorg/litegraph'
import { useNodeDefStore } from '@/stores/nodeDefStore'
import { useSettingStore } from '@/stores/settingStore'
@@ -422,7 +422,7 @@ export class PrimitiveNode extends LGraphNode {
}
}
export function getWidgetConfig(slot: INodeSlot) {
export function getWidgetConfig(slot: INodeInputSlot | INodeOutputSlot) {
return slot.widget[CONFIG] ?? slot.widget[GET_CONFIG]?.() ?? ['*', {}]
}