mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-07-28 08:46:35 +00:00
Added extra_dict to InputV3/WidgetInputV3 for custom node/widget expansion
This commit is contained in:
parent
002e16ac71
commit
aac91caf1a
@ -152,20 +152,21 @@ class InputV3(IO_V3):
|
|||||||
'''
|
'''
|
||||||
Base class for a V3 Input.
|
Base class for a V3 Input.
|
||||||
'''
|
'''
|
||||||
def __init__(self, id: str, display_name: str=None, optional=False, tooltip: str=None, lazy: bool=None):
|
def __init__(self, id: str, display_name: str=None, optional=False, tooltip: str=None, lazy: bool=None, extra_dict=None):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.id = id
|
self.id = id
|
||||||
self.display_name = display_name
|
self.display_name = display_name
|
||||||
self.optional = optional
|
self.optional = optional
|
||||||
self.tooltip = tooltip
|
self.tooltip = tooltip
|
||||||
self.lazy = lazy
|
self.lazy = lazy
|
||||||
|
self.extra_dict = extra_dict if extra_dict is not None else {}
|
||||||
|
|
||||||
def as_dict_V1(self):
|
def as_dict_V1(self):
|
||||||
return prune_dict({
|
return prune_dict({
|
||||||
"display_name": self.display_name,
|
"display_name": self.display_name,
|
||||||
"tooltip": self.tooltip,
|
"tooltip": self.tooltip,
|
||||||
"lazy": self.lazy
|
"lazy": self.lazy,
|
||||||
})
|
}) | prune_dict(self.extra_dict)
|
||||||
|
|
||||||
def get_io_type_V1(self):
|
def get_io_type_V1(self):
|
||||||
return self.io_type
|
return self.io_type
|
||||||
@ -176,8 +177,8 @@ class WidgetInputV3(InputV3):
|
|||||||
'''
|
'''
|
||||||
def __init__(self, id: str, display_name: str=None, optional=False, tooltip: str=None, lazy: bool=None,
|
def __init__(self, id: str, display_name: str=None, optional=False, tooltip: str=None, lazy: bool=None,
|
||||||
default: Any=None,
|
default: Any=None,
|
||||||
socketless: bool=None, widgetType: str=None, types: list[type[ComfyType] | ComfyType]=None):
|
socketless: bool=None, widgetType: str=None, types: list[type[ComfyType] | ComfyType]=None, extra_dict=None):
|
||||||
super().__init__(id, display_name, optional, tooltip, lazy)
|
super().__init__(id, display_name, optional, tooltip, lazy, extra_dict)
|
||||||
self.default = default
|
self.default = default
|
||||||
self.socketless = socketless
|
self.socketless = socketless
|
||||||
self.widgetType = widgetType
|
self.widgetType = widgetType
|
||||||
|
Loading…
x
Reference in New Issue
Block a user