Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hijack method error with Python 3.12 / comfy_execution error #49

Open
Danamir opened this issue Dec 3, 2024 · 2 comments
Open

hijack method error with Python 3.12 / comfy_execution error #49

Danamir opened this issue Dec 3, 2024 · 2 comments

Comments

@Danamir
Copy link

Danamir commented Dec 3, 2024

I recently upgraded my ComfyUI Python installation to 3.12 / Torch 2.5, and have an error in the hijack method since :

** Python version: 3.12.7 (tags/v3.12.7:0b05ead, Oct  1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]
pytorch version: 2.5.1+cu124
Traceback (most recent call last):
  File "F:\ComfyUI\nodes.py", line 2035, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "F:\ComfyUI\custom_nodes\ComfyUI-0246\__init__.py", line 1, in <module>
    from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "F:\ComfyUI\custom_nodes\ComfyUI-0246\nodes.py", line 1092, in <module>
    lib0246.hijack(comfy_graph, "get_input_info", get_input_info_param_handle, get_input_info_res_handle)
  File "F:\ComfyUI\custom_nodes\ComfyUI-0246\utils.py", line 345, in hijack
    old_func = getattr(scope, name)
               ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_input_info'

This seems to happen because the name func was not found in the scope. A simple fix is to handle the missing func case with a minor code modification :

old_func = getattr(scope, name, None)
if old_fund is None:
    return

With this modification the node loads correctly, but I did not test all of the functionalities with Python 3.12 .

Cheers,

@Trung0246
Copy link
Owner

Hm this looks more like comfy_execution folder is in unexpected place.

@Danamir
Copy link
Author

Danamir commented Dec 4, 2024

I installed some time ago from a git clone. So the comfy_execution directory is directly at the root of the installation, same structure as the repository. It may be different with the portable installation, I'm not sure.

@Danamir Danamir changed the title hijack method error with Python 3.12 hijack method error with Python 3.12 / comfy_execution error Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants