Fannovel16 / comfyui_controlnet_aux

ComfyUI's ControlNet Auxiliary Preprocessors
Apache License 2.0
1.65k stars 158 forks source link

ControlNet installation from ComfyUI Manager : No module named 'cv2' #371

Closed leez7onefl closed 1 month ago

leez7onefl commented 1 month ago

Hi everyone,

I want to share a problem I encountered and how to solve it. I installed this repo directly from the ComfyUI manager module, and the installation failed. All I was able to get was:

(IMPORT FAILED) [ComfyUI's ControlNet Auxiliary Preprocessors](https://github.com/Fannovel16/comfyui_controlnet_aux)
Cannot import F:\AI\image gen\ComfyUI config\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux module for custom nodes: No module named 'cv2'

SOLUTION:

I wanted to share that the install.bat file of comfyui_controlnet_aux:

...\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux\install.bat

May not install correctly if the path of your ComfyUI installation contains blank spaces, like this:

F:\MY AI FOLDER\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux\install.bat

You have to modify your parent folders to remove these blank spaces, for example, like this:

F:\MY_AI_FOLDER\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux\install.bat

It worked well for me.

Note that I also modified the install.bat file to give the exact path, from this:

set "python_exec=..\..\..\python_embeded\python.exe"

to this:

set "python_exec=F:\MY_AI_FOLDER\ComfyUI_windows_portable\python_embeded\python.exe"

Hope this may be helpful!