Skip to content

ComfyUI/Comfyui_Anyline Import Failed No module named 'custom_nodes.comfyui_controlnet_aux.src.controlnet_aux' #22

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

Open
Mann-robot opened this issue Aug 17, 2024 · 10 comments

Comments

@Mann-robot
Copy link

On Mac M2 silicon run ComfyUI

Traceback (most recent call last):
File "/Users/local/ComfyUI/nodes.py", line 1993, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/local/ComfyUI/custom_nodes/ComfyUI-Anyline/init.py", line 1, in
from .anyline import AnyLine
File "/Users/local/ComfyUI/custom_nodes/ComfyUI-Anyline/anyline.py", line 9, in
from custom_nodes.comfyui_controlnet_aux.src.controlnet_aux.teed import TEDDetector
ModuleNotFoundError: No module named 'custom_nodes.comfyui_controlnet_aux.src.controlnet_aux'

Cannot import /Users/local/ComfyUI/custom_nodes/ComfyUI-Anyline module for custom nodes: No module named 'custom_nodes.comfyui_controlnet_aux.src.controlnet_aux'

How to fix it?

@liangmou825
Copy link

This problem occurred after I updated comfyui. After rolling back the version, the problem still persisted. I tried reinstalling in various ways, but it couldn't be solved.

File "C:\Users\Administrator\Desktop\ComfyUI-V1.3\custom_nodes\ComfyUI-Anyline_init_.py", line 1, in
from .anyline import AnyLine
File "C:\Users\Administrator\Desktop\ComfyUI-V1.3\custom_nodes\ComfyUI-Anyline\anyline.py", line 8, in
from custom_nodes.comfyui_controlnet_aux.utils import common_annotator_call
ModuleNotFoundError: No module named 'custom_nodes.comfyui_controlnet_aux'

Cannot import C:\Users\Administrator\Desktop\ComfyUI-V1.3\custom_nodes\ComfyUI-Anyline module for custom nodes: No module named 'custom_nodes.comfyui_controlnet_aux'
Traceback (most recent call last):

@UnirionGames
Copy link

Temporary solution is to get back to a commit before renaming controlnet_aux core module

cd custom_nodes/comfyui_controlnet_aux
git checkout 3f716176ab698a33bd09607e285fc532f20bb63f

@water110
Copy link

water110 commented Aug 19, 2024

In the c47ccab version,comfyui-controlnet-aux Rename core module src.controlnet_aux to src.custom_controlnet_aux to avoid conflict with HuggingFace's controlnet_aux.So modify lines 9/10/11 of code in anyline.py as follows:
from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.teed import TEDDetector
from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.teed.ted import TED
from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.lineart_standard import LineartStandardDetector

@wogam
Copy link

wogam commented Aug 19, 2024

In the c47ccab version,comfyui-controlnet-aux Rename core module src.controlnet_aux to src.custom_controlnet_aux to avoid conflict with HuggingFace's controlnet_aux.So modify lines 9/10/11 of code in anyline.py as follows: from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.teed import TEDDetector from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.teed.ted import TED from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.lineart_standard import LineartStandardDetector

For the people that are skimming this thread this is the solution

@Mann-robot
Copy link
Author

In the c47ccab version,comfyui-controlnet-aux Rename core module src.controlnet_aux to src.custom_controlnet_aux to avoid conflict with HuggingFace's controlnet_aux.So modify lines 9/10/11 of code in anyline.py as follows: from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.teed import TEDDetector from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.teed.ted import TED from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.lineart_standard import LineartStandardDetector

For the people that are skimming this thread this is the solution

Thz, it works👍

@frankiedl
Copy link

@lellotrek install the controlnet auxilliary node.

@wangbaowen
Copy link

In the c47ccab version,comfyui-controlnet-aux Rename core module src.controlnet_aux to src.custom_controlnet_aux to avoid conflict with HuggingFace's controlnet_aux.So modify lines 9/10/11 of code in anyline.py as follows: from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.teed import TEDDetector from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.teed.ted import TED from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.lineart_standard import LineartStandardDetector

您好,请问要怎么修改,电脑小白

@s1u
Copy link

s1u commented Jan 14, 2025

In the c47ccab version,comfyui-controlnet-aux Rename core module src.controlnet_aux to src.custom_controlnet_aux to avoid conflict with HuggingFace's controlnet_aux.So modify lines 9/10/11 of code in anyline.py as follows: from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.teed import TEDDetector from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.teed.ted import TED from custom_nodes.comfyui_controlnet_aux.src.custom_controlnet_aux.lineart_standard import LineartStandardDetector

For the people that are skimming this thread this is the solution

Updated with these new ones, still not work.
No module named 'custom_nodes.comfyui_controlnet_aux', it can't find the directory custom_nodes, even comfyui_controlnet_aux actually installed.

@Ken-g6
Copy link

Ken-g6 commented Jan 18, 2025

Updated with these new ones, still not work. No module named 'custom_nodes.comfyui_controlnet_aux', it can't find the directory custom_nodes, even comfyui_controlnet_aux actually installed.

For some reason it's not getting installed automatically. Install from Manager, or from https://github.com/Fannovel16/comfyui_controlnet_aux

@Tody190
Copy link

Tody190 commented Feb 4, 2025

This problem occurred after I updated comfyui. After rolling back the version, the problem still persisted. I tried reinstalling in various ways, but it couldn't be solved.

File "C:\Users\Administrator\Desktop\ComfyUI-V1.3\custom_nodes\ComfyUI-Anyline__init__.py", line 1, in from .anyline import AnyLine File "C:\Users\Administrator\Desktop\ComfyUI-V1.3\custom_nodes\ComfyUI-Anyline\anyline.py", line 8, in from custom_nodes.comfyui_controlnet_aux.utils import common_annotator_call ModuleNotFoundError: No module named 'custom_nodes.comfyui_controlnet_aux'

Cannot import C:\Users\Administrator\Desktop\ComfyUI-V1.3\custom_nodes\ComfyUI-Anyline module for custom nodes: No module named 'custom_nodes.comfyui_controlnet_aux' Traceback (most recent call last):

I modified lines 8-10 to:

import os
import sys
custom_nodes_directory = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if custom_nodes_directory not in sys.path:
    sys.path.append(custom_nodes_directory)
    print("[Debug] Added to sys.path:", custom_nodes_directory)
else:
    print("[Debug] Path already in sys.path")

# Requires comfyui_controlnet_aux funcsions and classes
from comfyui_controlnet_aux.utils import common_annotator_call
from comfyui_controlnet_aux.src.controlnet_aux.teed import TEDDetector
from comfyui_controlnet_aux.src.controlnet_aux.teed.ted import TED
from comfyui_controlnet_aux.src.controlnet_aux.lineart_standard import LineartStandardDetector as LineartStandardDetect

The issue occurred because:

The author didn't add the custom_nodes path to sys.path, causing the script to fail locating the modules

Some module import names were incorrect, which might be due to comfyui_controlnet_aux updates changing certain module names

This modification should resolve both the path configuration and the updated module reference issues.

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

11 participants