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

ModuleNotFoundError for handful of nodes #3

Closed
Lightsockie opened this issue Aug 17, 2023 · 23 comments
Closed

ModuleNotFoundError for handful of nodes #3

Lightsockie opened this issue Aug 17, 2023 · 23 comments

Comments

@Lightsockie
Copy link

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
Copy link
Author

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

- Navigate to your `was-node-suite-comfyui` folder

echo Installing WAS-NS ...

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

@Lightsockie Lightsockie changed the title ModuleNotFoundError for all nodes ModuleNotFoundError for handful of nodes Aug 17, 2023
@Lightsockie
Copy link
Author

Lightsockie commented Aug 17, 2023

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
Copy link
Owner

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

- Navigate to your `was-node-suite-comfyui` folder

echo Installing WAS-NS ...

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
Copy link
Owner

Fannovel16 commented Aug 18, 2023

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
Copy link
Owner

Can you test the new commit?
adbce8d

@xqterry
Copy link

xqterry commented Aug 18, 2023

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/

@Fannovel16
Copy link
Owner

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
Copy link
Author

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 2a0ee39

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

@Fannovel16
Copy link
Owner

Fannovel16 commented Aug 18, 2023

@Lightsockie Can you test the newest commit for once more time?
f5ca242

@Lightsockie
Copy link
Author

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: 4a0df2b (I can roll back to f5ca242, 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
Copy link

Piscabo commented Aug 18, 2023

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
Copy link

ejrejr commented Aug 18, 2023

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
Copy link
Contributor

tungnguyensipher commented Aug 18, 2023

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
Copy link

ejrejr commented Aug 18, 2023

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

@pdaignau
Copy link

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
Copy link
Owner

@pdaignau Fixed at d859770

@Fannovel16
Copy link
Owner

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.

@Mets3D
Copy link

Mets3D commented Aug 19, 2023

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
Copy link
Owner

@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
Copy link

Mets3D commented Aug 19, 2023

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
Copy link

cmon, manager version is still borked

@2blackbar
Copy link

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
Copy link
Author

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: f99b09b

Screenshot 2023-08-21 at 16 00 00

aganoob pushed a commit to aganoob/video_controlnet_aux that referenced this issue Feb 21, 2024
Foligattilj added a commit to Foligattilj/comfyui_controlnet_aux that referenced this issue Jul 24, 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

9 participants