25 lines
787 B
Python
25 lines
787 B
Python
from .nodes.nodes import *
|
|
from .nodes.image_nodes import *
|
|
|
|
|
|
NODE_CONFIG = {
|
|
"BboxesVisualize": {"class": BboxesVisualize, "name": "Bounding Boxes Visualize"},
|
|
}
|
|
|
|
def generate_node_mappings(node_config):
|
|
node_class_mappings = {}
|
|
node_display_name_mappings = {}
|
|
|
|
for node_name, node_info in node_config.items():
|
|
node_class_mappings[node_name] = node_info["class"]
|
|
node_display_name_mappings[node_name] = node_info.get("name", node_info["class"].__name__)
|
|
|
|
return node_class_mappings, node_display_name_mappings
|
|
|
|
|
|
# Map all your custom nodes classes with the names that will be displayed in the UI.
|
|
NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS = generate_node_mappings(NODE_CONFIG)
|
|
|
|
|
|
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
|