19 lines
556 B
Python
19 lines
556 B
Python
import importlib
|
|
import inspect
|
|
|
|
NODE_CLASS_MAPPINGS = {}
|
|
NODE_DISPLAY_NAME_MAPPINGS = {}
|
|
|
|
nodes_filename = "nodes"
|
|
module = importlib.import_module(f".{nodes_filename}", package=__name__)
|
|
for name, cls in inspect.getmembers(module, inspect.isclass):
|
|
if cls.__module__ == module.__name__:
|
|
name = name.replace("_", " ")
|
|
|
|
node = f"[ComfyUI-3D] {name}"
|
|
disp = f"{name}"
|
|
|
|
NODE_CLASS_MAPPINGS[node] = cls
|
|
NODE_DISPLAY_NAME_MAPPINGS[node] = disp
|
|
|
|
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS'] |