Line data Source code
1 : import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
2 : import type { IBaseWidget } from '@comfyorg/graph-model/widgets'
3 : import type { InputSpec as InputSpecV2 } from '@comfyorg/object-info-parser/schemas/nodeDefSchemaV2'
4 : import type { ComfyWidgetConstructorV2 } from '@/types/widgetConstructor'
5 :
6 2356 : export const usePainterWidget = (): ComfyWidgetConstructorV2 => {
7 2356 : return (node: LGraphNode, inputSpec: InputSpecV2): IBaseWidget => {
8 32 : return node.addWidget('painter', inputSpec.name, inputSpec.default, null, {
9 : hideInPanel: true
10 : })
11 : }
12 : }
|