comfyui_controlnet_aux: ModuleNotFoundError for handful of nodes

Saw the other repo was archived, so just now replaced it with this one. When I try to use any of the nodes, though, I got an error. So I looked back on the startup log and see this. I get a Traceback for each module, but just showing the last one here for brevity (they’re all the same ModuleNotFoundError issue).

I installed via ComfyUI-Manager. After I saw the errors I manually installed the requirements.txt file, too, to rule that out as an issue. The error tells me to make sure I installed any dependencies correctly, but I don’t see anything more “dependencies” to install beyond this.

Traceback (most recent call last):
  File "/home/user/Work/StableDiffusion/ComfyUI/custom_nodes/comfyui_controlnet_aux/__init__.py", line 22, in load_nodes
    module = importlib.import_module(
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/user/Work/StableDiffusion/ComfyUI/custom_nodes/comfyui_controlnet_aux/node_wrappers/zoe.py", line 2, in <module>
    from controlnet_aux.zoe import ZoeDetector
ModuleNotFoundError: No module named 'controlnet_aux.zoe'



[comfyui_controlnet_aux] | INFO -> Some nodes failed to load:
        Failed to import module manga_line because ModuleNotFoundError: No module named 'controlnet_aux.manga_line'
        Failed to import module openpose because ModuleNotFoundError: No module named 'controlnet_aux.dwpose'
        Failed to import module oneformer because ModuleNotFoundError: No module named 'controlnet_aux.oneformer'
        Failed to import module scribble because ModuleNotFoundError: No module named 'controlnet_aux.scribble'
        Failed to import module leres because ModuleNotFoundError: No module named 'controlnet_aux.leres'
        Failed to import module uniformer because ModuleNotFoundError: No module named 'controlnet_aux.uniformer'
        Failed to import module zoe because ModuleNotFoundError: No module named 'controlnet_aux.zoe'

Torch versions:

torch==2.1.0.dev20230726+rocm5.6
torchaudio==2.1.0.dev20230727+rocm5.6
torchvision==0.16.0.dev20230727+rocm5.6

When I look in the ckpts folder I see ckpts/models--lllyasviel--Annotators which seems wrong? Especially since I see elsewhere in code references to the path llyasviel/Annotators. Could be there’s a windows problem on some of the stuff, so maybe there’s a pathing issue where ckpts/models\lllyasviel\Annotators is translating wrong and messing up the imports?

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 23 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Quick fix: edit the __init__.py and add the following line on line 11:

sys.path.insert(0, str(Path(here, "src").resolve()))
image

What other version of controlnet-aux is out there? That needs to go into requirements.txt, otherwise the errors will keep occurring for people who don’t already have those modules installed as a dependency from some other project.

+1 to the quick fix @tungnguyensipher ! Thank you. All start-up issues are gone, no node not-loaded warnings, no red nodes.

Close this isssue as it is fixed at https://github.com/Fannovel16/comfyui_controlnet_aux/commit/582f0ad80ef8c2794cfd95a10976f8f5b7a439ae. Thanks @tungnguyensipher for the fix. I’m still an amateur so this kind of issue is hard for me to fix.