COMFY_API_NODE_NAME node property

This commit is contained in:
bymyself 2025-04-15 16:38:03 -07:00 committed by Robin Huang
parent 92e053d430
commit 06819aa865
2 changed files with 6 additions and 1 deletions

View File

@ -1,7 +1,7 @@
"""Comfy-specific type hinting""" """Comfy-specific type hinting"""
from __future__ import annotations from __future__ import annotations
from typing import Literal, TypedDict from typing import Literal, TypedDict, Optional
from typing_extensions import NotRequired from typing_extensions import NotRequired
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from enum import Enum from enum import Enum
@ -229,6 +229,8 @@ class ComfyNodeABC(ABC):
"""Flags a node as experimental, informing users that it may change or not work as expected.""" """Flags a node as experimental, informing users that it may change or not work as expected."""
DEPRECATED: bool DEPRECATED: bool
"""Flags a node as deprecated, indicating to users that they should find alternatives to this node.""" """Flags a node as deprecated, indicating to users that they should find alternatives to this node."""
COMFY_API_NODE_NAME: Optional[str]
"""If the node is an API node, this is the name used to identify it."""
@classmethod @classmethod
@abstractmethod @abstractmethod

View File

@ -580,6 +580,9 @@ class PromptServer():
info['deprecated'] = True info['deprecated'] = True
if getattr(obj_class, "EXPERIMENTAL", False): if getattr(obj_class, "EXPERIMENTAL", False):
info['experimental'] = True info['experimental'] = True
if hasattr(obj_class, 'COMFY_API_NODE_NAME'):
info['comfy_api_node_name'] = obj_class.COMFY_API_NODE_NAME
return info return info
@routes.get("/object_info") @routes.get("/object_info")