Add python_module to node info
This PR add node class's RELATIVE_PYTHON_MODULE to node def object returned by /object_info API endpoint. RELATIVE_PYTHON_MODULE is the relative python module path against the project root, e.g. custom_nodes.foo
This will help show the node belongs to which custom node pack in the redesigned node search box. https://github.com/Comfy-Org/ComfyUI_frontend/pull/83
How to verify
-
cd tests-ui/ -
npm i -
npm test:generate - Inspect
tests-ui/data/object_info.json
Some examples:
Built-in node
"name": "CheckpointLoaderSimple",
"display_name": "Load Checkpoint",
"description": "",
"python_module": "nodes", <------
"category": "loaders",
"output_node": false
Custom node
"name": "ResizeMask",
"display_name": "ResizeMask",
"description": "\nResizes the mask or batch of masks to the specified width and height.\n",
"python_module": "custom_nodes.ComfyUI-KJNodes.nodes.nodes", <-----
"category": "KJNodes/masking",
"output_node": false
I'm not sure if returning the full paths is a good idea, it might be better to return just the custom node name.
I'm not sure if returning the full paths is a good idea, it might be better to return just the custom node name.
The full path comes from the loading of modules with abs path here: https://github.com/comfyanonymous/ComfyUI/blob/24b969d3dace581ed3fb547eedfbdf502ad0f7e9/nodes.py#L1974-L2018
I will fix it so that we can have consistent __module__ format. I am also fine if we just attach custom node folder name.
@comfyanonymous Can you take a look again? I have fixed module names passed to frontend to be relative module name against ComfyUI root.
The change does not affect current module loading.
Note: frontend visual
