mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-01 12:52:35 +08:00
feat: add essentials_category field to node schema
Amp-Thread-ID: https://ampcode.com/threads/T-019c2b25-cd90-7218-9071-03cb46b351b3
This commit is contained in:
parent
26dd7eb421
commit
078008b734
@ -1309,6 +1309,7 @@ class NodeInfoV1:
|
|||||||
api_node: bool=None
|
api_node: bool=None
|
||||||
price_badge: dict | None = None
|
price_badge: dict | None = None
|
||||||
search_aliases: list[str]=None
|
search_aliases: list[str]=None
|
||||||
|
essentials_category: str=None
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@ -1430,6 +1431,8 @@ class Schema:
|
|||||||
"""Flags a node as expandable, allowing NodeOutput to include 'expand' property."""
|
"""Flags a node as expandable, allowing NodeOutput to include 'expand' property."""
|
||||||
accept_all_inputs: bool=False
|
accept_all_inputs: bool=False
|
||||||
"""When True, all inputs from the prompt will be passed to the node as kwargs, even if not defined in the schema."""
|
"""When True, all inputs from the prompt will be passed to the node as kwargs, even if not defined in the schema."""
|
||||||
|
essentials_category: str | None = None
|
||||||
|
"""Optional category for the Essentials tab. Path-based like category field (e.g., 'Basic', 'Image Tools/Editing')."""
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
'''Validate the schema:
|
'''Validate the schema:
|
||||||
@ -1536,6 +1539,7 @@ class Schema:
|
|||||||
python_module=getattr(cls, "RELATIVE_PYTHON_MODULE", "nodes"),
|
python_module=getattr(cls, "RELATIVE_PYTHON_MODULE", "nodes"),
|
||||||
price_badge=self.price_badge.as_dict(self.inputs) if self.price_badge is not None else None,
|
price_badge=self.price_badge.as_dict(self.inputs) if self.price_badge is not None else None,
|
||||||
search_aliases=self.search_aliases if self.search_aliases else None,
|
search_aliases=self.search_aliases if self.search_aliases else None,
|
||||||
|
essentials_category=self.essentials_category,
|
||||||
)
|
)
|
||||||
return info
|
return info
|
||||||
|
|
||||||
|
|||||||
@ -687,6 +687,10 @@ class PromptServer():
|
|||||||
info['api_node'] = obj_class.API_NODE
|
info['api_node'] = obj_class.API_NODE
|
||||||
|
|
||||||
info['search_aliases'] = getattr(obj_class, 'SEARCH_ALIASES', [])
|
info['search_aliases'] = getattr(obj_class, 'SEARCH_ALIASES', [])
|
||||||
|
|
||||||
|
if hasattr(obj_class, 'ESSENTIALS_CATEGORY'):
|
||||||
|
info['essentials_category'] = obj_class.ESSENTIALS_CATEGORY
|
||||||
|
|
||||||
return info
|
return info
|
||||||
|
|
||||||
@routes.get("/object_info")
|
@routes.get("/object_info")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user