Skip to content

Commit 078008b

Browse files
feat: add essentials_category field to node schema
Amp-Thread-ID: https://ampcode.com/threads/T-019c2b25-cd90-7218-9071-03cb46b351b3
1 parent 26dd7eb commit 078008b

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

comfy_api/latest/_io.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,7 @@ class NodeInfoV1:
13091309
api_node: bool=None
13101310
price_badge: dict | None = None
13111311
search_aliases: list[str]=None
1312+
essentials_category: str=None
13121313

13131314

13141315
@dataclass
@@ -1430,6 +1431,8 @@ class Schema:
14301431
"""Flags a node as expandable, allowing NodeOutput to include 'expand' property."""
14311432
accept_all_inputs: bool=False
14321433
"""When True, all inputs from the prompt will be passed to the node as kwargs, even if not defined in the schema."""
1434+
essentials_category: str | None = None
1435+
"""Optional category for the Essentials tab. Path-based like category field (e.g., 'Basic', 'Image Tools/Editing')."""
14331436

14341437
def validate(self):
14351438
'''Validate the schema:
@@ -1536,6 +1539,7 @@ def get_v1_info(self, cls) -> NodeInfoV1:
15361539
python_module=getattr(cls, "RELATIVE_PYTHON_MODULE", "nodes"),
15371540
price_badge=self.price_badge.as_dict(self.inputs) if self.price_badge is not None else None,
15381541
search_aliases=self.search_aliases if self.search_aliases else None,
1542+
essentials_category=self.essentials_category,
15391543
)
15401544
return info
15411545

server.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,10 @@ def node_info(node_class):
687687
info['api_node'] = obj_class.API_NODE
688688

689689
info['search_aliases'] = getattr(obj_class, 'SEARCH_ALIASES', [])
690+
691+
if hasattr(obj_class, 'ESSENTIALS_CATEGORY'):
692+
info['essentials_category'] = obj_class.ESSENTIALS_CATEGORY
693+
690694
return info
691695

692696
@routes.get("/object_info")

0 commit comments

Comments
 (0)