Open trojblue opened 1 week ago
update: adding a try-except block seems to fix it?
def _ensure_package_dicts_exist(module_name: str):
try:
package_name = module_name.split('.')[-2]
except IndexError: # package installed with pip install -e .
package_name = module_name
init code:
import easy_nodes
easy_nodes.initialize_easy_nodes(default_category="ComfyUI Router", auto_register=True)
from .comfy_nodes import * # noqa: F403, E402
# NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS = easy_nodes.get_node_mappings()
# print("NODE_CLASS_MAPPINGS", NODE_CLASS_MAPPINGS)
# print("NODE_DISPLAY_NAME_MAPPINGS", NODE_DISPLAY_NAME_MAPPINGS)
# __all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
# Optional: export the node list to a file so that e.g. ComfyUI-Manager can pick it up.
# easy_nodes.save_node_list(os.path.join(os.path.dirname(__file__), "node_list.json"))
here: https://github.com/andrewharp/ComfyUI-EasyNodes/blob/a2aeb8bfca654b2c4881975f9fc89d03218a2b8b/easy_nodes/easy_nodes.py#L718
the
module_name
getting passed into it iscomfyui-router
, which does not contain any dots, therefore gets a import failed error:node folder init code:
the code works fine before I updated comfyui from 0.19 to latest (
9c5fca75f46f7b9f18c07385925f151a7629a94f
). I tried using auto_register=False, which gets imported successfully, but if i add a debug print theframe
is still a string with no dots