File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 1+ from inference_core_nodes import NODE_CLASS_MAPPINGS , NODE_DISPLAY_NAME_MAPPINGS
2+
3+ __all__ = ("NODE_CLASS_MAPPINGS" , "NODE_DISPLAY_NAME_MAPPINGS" )
Original file line number Diff line number Diff line change 1- __version__ = "0.1.0"
1+ __all__ = ("__version__" , "NODE_CLASS_MAPPINGS" , "NODE_DISPLAY_NAME_MAPPINGS" )
2+
3+ __version__ = "0.1.0"
4+
5+
6+ def _get_node_mappings ():
7+ import importlib
8+ import pkgutil
9+
10+ node_class_mappings = {}
11+ node_display_name_mappings = {}
12+
13+ for submodule_info in pkgutil .iter_modules (__path__ ):
14+ # import
15+ submodule = importlib .import_module (f"{ __name__ } .{ submodule_info .name } " )
16+
17+ node_class_mappings .update (getattr (submodule , "NODE_CLASS_MAPPINGS" ))
18+ node_display_name_mappings .update (
19+ getattr (submodule , "NODE_DISPLAY_NAME_MAPPINGS" )
20+ )
21+
22+ return node_class_mappings , node_display_name_mappings
23+
24+
25+ NODE_CLASS_MAPPINGS , NODE_DISPLAY_NAME_MAPPINGS = _get_node_mappings ()
You can’t perform that action at this time.
0 commit comments