Fannovel16 / comfyui_controlnet_aux

ComfyUI's ControlNet Auxiliary Preprocessors
Apache License 2.0
2.18k stars 201 forks source link

ModuleNotFoundError for handful of nodes #3

Closed Lightsockie closed 1 year ago

Lightsockie commented 1 year ago

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?

Lightsockie commented 1 year ago

Also, not really worth opening a new issue for since the repo is still pretty young it looks like, but https://github.com/Fannovel16/comfyui_controlnet_aux/blob/0348d825cc2137349bbcead83d049f862627fd7e/README.md?plain=1#L25 https://github.com/Fannovel16/comfyui_controlnet_aux/blob/0348d825cc2137349bbcead83d049f862627fd7e/install.bat#L6 seems like there's still some cruft from importing over stuff from WAS? (Maybe elsewhere too)

Lightsockie commented 1 year ago

Actually it's not all nodes this fails for, it's just ~7 out of the bunch. When I try to use any of the other modules, though, I get an error like the following. I can open a new issue if it helps, but might be same root cause

Error occurred when executing LineArtPreprocessor:

'LineartDetector' object has no attribute 'to'

  File "/home/user/Work/StableDiffusion/ComfyUI/execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/Work/StableDiffusion/ComfyUI/execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/Work/StableDiffusion/ComfyUI/execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/Work/StableDiffusion/ComfyUI/custom_nodes/comfyui_controlnet_aux/node_wrappers/lineart.py", line 21, in execute
    model = LineartDetector.from_pretrained(HF_MODEL_NAME, cache_dir=annotator_ckpts_path).to(model_management.get_torch_device())
Fannovel16 commented 1 year ago

Also, not really worth opening a new issue for since the repo is still pretty young it looks like, but

https://github.com/Fannovel16/comfyui_controlnet_aux/blob/0348d825cc2137349bbcead83d049f862627fd7e/README.md?plain=1#L25

https://github.com/Fannovel16/comfyui_controlnet_aux/blob/0348d825cc2137349bbcead83d049f862627fd7e/install.bat#L6

seems like there's still some cruft from importing over stuff from WAS? (Maybe elsewhere too)

I actually copied the installation guide and script from him and the logger from comfyui_mtb.

Fannovel16 commented 1 year ago

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?

I think that is not true because I use huggingface_hub to handle the downloading. May be sys.path.append(str(Path(here, "src"))) doesn't do it job properly ig.

Fannovel16 commented 1 year ago

Can you test the new commit? https://github.com/Fannovel16/comfyui_controlnet_aux/commit/adbce8dd8753ac2d3a715b844fedf45e63943f2c

xqterry commented 1 year ago

There are missing “__init__.py” in your package directory, so importlib won't import contronetaux even src added to sys.path. I put empty “__init_\.py” to following directories then works:

Fannovel16 commented 1 year ago

There are missing “init.py” in your package directory, so importlib won't import contronet_aux even src added to sys.path. I put empty “init.py” to following directories then works:

  • comfyui_controlnet_aux/src/
  • comfyui_controlnet_aux/src/controlnet_aux/

Oh thanks for your tip!

Lightsockie commented 1 year ago

Might've got a little worse:

Traceback (most recent call last):
  File "/home/user/Work/StableDiffusion/ComfyUI/custom_nodes/comfyui_controlnet_aux/__init__.py", line 23, 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 color because ModuleNotFoundError: No module named 'controlnet_aux.color'
        Failed to import module dwpose because ModuleNotFoundError: No module named 'controlnet_aux.dwpose'
        Failed to import module mediapipe_face because ModuleNotFoundError: No module named 'controlnet_aux.mediapipe_face'
        Failed to import module oneformer because ModuleNotFoundError: No module named 'controlnet_aux.oneformer'
        Failed to import module binary because ModuleNotFoundError: No module named 'controlnet_aux.binary'
        Failed to import module segment_anything because ModuleNotFoundError: No module named 'controlnet_aux.segment_anything'
        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'

On commit https://github.com/Fannovel16/comfyui_controlnet_aux/commit/2a0ee392ba089c918eee2fb11f8c29a87ea38e46

Tried first with the old repo enabled, and again without. Same runtime errors as well

Fannovel16 commented 1 year ago

@Lightsockie Can you test the newest commit for once more time? https://github.com/Fannovel16/comfyui_controlnet_aux/commit/f5ca2429d05d4268c292fbde15f9bcd85725b2a0

Lightsockie commented 1 year ago

Looks like it's still ain't happy. Just did a fresh clone of ComfyUI (using pre-existing venv), with only ComfyUI-Manager and controlnet_aux, to eliminate as much variables as possible. ComfyUI Commit: d6e4b342e6171e0c89fed1ec9998b608888af401 controlnet_aux: https://github.com/Fannovel16/comfyui_controlnet_aux/commit/4a0df2b61ea9cd44fa7ac3a61e2be17d77c9626a (I can roll back to https://github.com/Fannovel16/comfyui_controlnet_aux/commit/f5ca2429d05d4268c292fbde15f9bcd85725b2a0, but it looked like subsequent commits were meant to tweak that so went with HEAD)

Full error:

$ python main.py --listen   
** ComfyUI start up time: 2023-08-18 11:57:13.636414

Prestartup times for custom nodes:
   0.0 seconds: /home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/ComfyUI-Manager

Total VRAM 20464 MB, total RAM 63441 MB
Set vram state to: NORMAL_VRAM
/home/user/Work/StableDiffusion/ComfyUI/venv/lib/python3.11/site-packages/torch/cuda/__init__.py:565: UserWarning: Can't initialize NVML
  warnings.warn("Can't initialize NVML")
Device: cuda:0 AMD Radeon RX 7900 XT : native
Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
Registered sys.path: ['/home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/comfyui_controlnet_aux/src/custom_pycocotools', '/home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/comfyui_controlnet_aux/src/custom_oneformer', '/home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/comfyui_controlnet_aux/src/custom_mmpkg', '/home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/comfyui_controlnet_aux/src/controlnet_aux', '/home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/comfyui_controlnet_aux/src/custom_detectron2', '/home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/comfyui_controlnet_aux/src/__init__.py', '/home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/comfyui_controlnet_aux/src/custom_midas_repo', '/home/user/Work/StableDiffusion/ComfyUI2/comfy', '/home/user/Work/StableDiffusion/ComfyUI2', '/usr/lib/python311.zip', '/usr/lib/python3.11', '/usr/lib/python3.11/lib-dynload', '/home/user/Work/StableDiffusion/ComfyUI/venv/lib/python3.11/site-packages']

             ^^^^^^^^^^^^^^^^^^^^^^^^
  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/ComfyUI2/custom_nodes/comfyui_controlnet_aux/node_wrappers/color.py", line 2, in <module>
    from controlnet_aux.color import ColorDetector
ModuleNotFoundError: No module named 'controlnet_aux.color'

Traceback (most recent call last):
  File "/home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/comfyui_controlnet_aux/__init__.py", line 25, 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/ComfyUI2/custom_nodes/comfyui_controlnet_aux/node_wrappers/dwpose.py", line 2, in <module>
    from controlnet_aux.dwpose import DwposeDetector
ModuleNotFoundError: No module named 'controlnet_aux.dwpose'

Traceback (most recent call last):
  File "/home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/comfyui_controlnet_aux/__init__.py", line 25, 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 "<
  File "/home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/comfyui_controlnet_aux/node_wrappers/oneformer.py", line 2, in <module>
    from controlnet_aux.oneformer import OneformerSegmentor
ModuleNotFoundError: No module named 'controlnet_aux.oneformer'

Traceback (most recent call last):
  File "/home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/comfyui_controlnet_aux/__init__.py", line 25, 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/ComfyUI2/custom_nodes/comfyui_controlnet_aux/node_wrappers/binary.py", line 2, in <module>
    from controlnet_aux.binary import BinaryDetector
ModuleNotFoundError: No module named 'controlnet_aux.binary'

Traceback (most recent call last):
  File "/home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/comfyui_controlnet_aux/__init__.py", line 25, 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/ComfyUI2/custom_nodes/comfyui_controlnet_aux/node_wrappers/segment_anything.py", line 2, in <module>
    from controlnet_aux.segment_anything import SamDetector
ModuleNotFoundError: No module named 'controlnet_aux.segment_anything'

Traceback (most recent call last):
  Fi
             ^^^^^^^^^^^^^^^^^^^^^^^^
  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/ComfyUI2/custom_nodes/comfyui_controlnet_aux/node_wrappers/leres.py", line 2, in <module>
    from controlnet_aux.leres import LeresDetector
ModuleNotFoundError: No module named 'controlnet_aux.leres'

Traceback (most recent call last):
  File "/home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/comfyui_controlnet_aux/__init__.py", line 25, 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/ComfyUI2/custom_nodes/comfyui_controlnet_aux/node_wrappers/uniformer.py", line 2, in <module>
    from controlnet_aux.uniformer import UniformerSegmentor
ModuleNotFoundError: No module named 'controlnet_aux.uniformer'

Traceback (most recent call last):
  File "/home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/comfyui_controlnet_aux/__init__.py", line 25, 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/ComfyUI2/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 color because ModuleNotFoundError: No module named 'controlnet_aux.color'
        Failed to import module dwpose because ModuleNotFoundError: No module named 'controlnet_aux.dwpose'
        Failed to import module mediapipe_face because ModuleNotFoundError: No module named 'controlnet_aux.mediapipe_face'
        Failed to import module oneformer because ModuleNotFoundError: No module named 'controlnet_aux.oneformer'
        Failed to import module binary because ModuleNotFoundError: No module named 'controlnet_aux.binary'
        Failed to import module segment_anything because ModuleNotFoundError: No module named 'controlnet_aux.segment_anything'
        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'

Check that you properly installed the dependencies.
If you think this is a bug, please report it on the github page (https://github.com/Fannovel16/comfyui_controlnet_aux/issues)
### Loading: ComfyUI-Manager (V0.23.2)
### ComfyUI Revision: 1313 [d6e4b342]
### ComfyUI-Manager: Copy .js from '/home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/ComfyUI-Manager/js/comfyui-manager.js' to '/home/user/Work/StableDiffusion/ComfyUI2/web/extensions/comfyui-manager'

Import times for custom nodes:
   0.0 seconds: /home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/ComfyUI-Manager
   0.1 seconds: /home/user/Work/StableDiffusion/ComfyUI2/custom_nodes/comfyui_controlnet_aux

Starting server

To see the GUI go to: http://0.0.0.0:8188
Piscabo commented 1 year ago

Same error for me. [comfyui_controlnet_aux] | INFO -> Some nodes failed to load: Failed to import module binary because ModuleNotFoundError: No module named 'controlnet_aux.binary' Failed to import module color because ModuleNotFoundError: No module named 'controlnet_aux.color' Failed to import module dwpose because ModuleNotFoundError: No module named 'controlnet_aux.dwpose' Failed to import module manga_line because ModuleNotFoundError: No module named 'controlnet_aux.manga_line' 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 uniformer because ModuleNotFoundError: No module named 'controlnet_aux.uniformer'

ejrejr commented 1 year ago

I just installed as well off of ComfyUI Manager just a few minutes ago and get very similar init.py issues (attached) - happy to do a new pull and test.

ComfyUI-ControlNet-StartupIssues.txt

tungnguyensipher commented 1 year ago

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

sys.path.insert(0, str(Path(here, "src").resolve()))
image
ejrejr commented 1 year ago

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

pdaignau commented 1 year ago

This fixed the loading issue for me. Note, make sure you restart ComfyUI and any prior windows/tabs you had open.

Unsure if its related, but Is anyone else having issues with the "UniFormer Segmentor" and "OpenPose Pose Recognition" nodes? I'm using the test JSON file at the bottom of the README.md (test_cn_aux_full.json).

Fannovel16 commented 1 year ago

@pdaignau Fixed at https://github.com/Fannovel16/comfyui_controlnet_aux/commit/d8597704a5870940740f06b35169566334e6d48f

Fannovel16 commented 1 year ago

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.

Mets3D commented 1 year ago

I found another project with a similar purpose (due to running into this error) I just got here seconds after you made a fix, but, I'll post it anyways, it's here. Not to deter you from your efforts, just in case it's doing what you're trying to do and you just weren't aware of it.

Also, your fix won't really fix things (just by looking at the code) you just shifted the error from import-time to when somebody actually tries executing those nodes. The modules you're trying to import there are simply not part of the controlnet-aux.0.0.6 python module that is on PyPi. Nor in 0.0.3 or 0.0.1, so, I'm not sure what's going on there.

That said, I'm surprised 2 people said the 1-line fix was enough for them, for me, it made no difference.

Keep up the good work, ya'll.

Fannovel16 commented 1 year ago

@Mets3D That is why I use sys.path.insert and sys.path.append. sys.path is a list of directories that the interpreter will search in for the required module (except ones imported through relative paths). But I don't sure how it works tho. For some reasons the env of my PC doesn't need that line but others need.

Also the repo you mentioned use the original controlnet-aux which doesn't have stuffs like DWPose or OneFormer.

Mets3D commented 1 year ago

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.

2blackbar commented 1 year ago

cmon, manager version is still borked

2blackbar commented 1 year ago

Close this isssue as it is fixed at 582f0ad. Thanks @tungnguyensipher for the fix. I'm still an amateur so this kind of issue is hard for me to fix.

not fixed, if you install with manager and it wont error out then you can call it being fixed

Lightsockie commented 1 year ago

Just re-tested in my "clean" env (just ComfyUI-Manager & this custom node). Confirming this issue is resolved, but there are still some nodes failing that likely need their own issues. Seems kinda odd to use the sys.path like this, but yolo I guess

comfy: bc76b3829f5fbba7c5a439c7833d313a3ca87398 control_aux: f99b09b5bc659e68524e0b52a971d2e7f769caae

Screenshot 2023-08-21 at 16 00 00