zero123 icon indicating copy to clipboard operation
zero123 copied to clipboard

Fix problem `AttributeError: module 'cv2.gapi.wip.draw' has no attribute 'Text'`

Open Matt-V50 opened this issue 1 year ago • 5 comments

It's a Opencv conflict

Which is mentioned here

Matt-V50 avatar Dec 05 '23 07:12 Matt-V50

Hi, the command works for me, but when I restart ComfyUI the next day the problem comes back.. And I have to launch the fix command again for it to work... Is it normal? How to fix it permanently? Thank you

riccardobiagi avatar Dec 05 '23 09:12 riccardobiagi

Hi, the command works for me, but when I restart ComfyUI the next day the problem comes back.. And I have to launch the fix command again for it to work... Is it normal? How to fix it permanently? Thank you

@riccardobiagi

I'm not very sure, maybe it depends on the way how you use comfyui.

Here are some of my guesses

  • Docker environment
    • If you restart it with some command like docker composer up --build, it will recreate the whole docker environment.
  • If you have a comfyui plugin or custom_nodes, it will check all the requirements from node git directors, and install all miss packages.

My advice

Make sure that all projects run under an independent environment separately.

In my experience, conda is better than venv

Matt-V50 avatar Dec 05 '23 13:12 Matt-V50

Hi, the command works for me, but when I restart ComfyUI the next day the problem comes back.. And I have to launch the fix command again for it to work... Is it normal? How to fix it permanently? Thank you

@riccardobiagi

I'm not very sure, maybe it depends on the way how you use comfyui.

Here are some of my guesses

  • Docker environment

    • If you restart it with some command like docker composer up --build, it will recreate the whole docker environment.
  • If you have a comfyui plugin or custom_nodes, it will check all the requirements from node git directors, and install all miss packages.

My advice

Make sure that all projects run under an independent environment separately.

In my experience, conda is better than venv

Hi FavorMyLikes, thanks a lot for the feedback! Unfortunately I'm really not a pyton/terminal guy.. I'm using a Mac M1 and I think I'm using conda (but who knows? :( ) . I start comfyui with this code:

cd ComfyUI python main.py --force-fp16

I have some custom nodes

Untill recently everything was working good, then I don't know what happened (maybe updating) to cause this problem that cause controlnet and other custom nodes to stop working. I see messages like: Cannot import /Users/../ComfyUI/custom_nodes/comfyui_controlnet_aux module for custom nodes: module 'cv2.gapi.wip.draw' has no attribute 'Text'

Any help will be much appreciated :(

riccardobiagi avatar Dec 08 '23 12:12 riccardobiagi

Hi, the command works for me, but when I restart ComfyUI the next day the problem comes back.. And I have to launch the fix command again for it to work... Is it normal? How to fix it permanently? Thank you

@riccardobiagi I'm not very sure, maybe it depends on the way how you use comfyui. Here are some of my guesses

  • Docker environment

    • If you restart it with some command like docker composer up --build, it will recreate the whole docker environment.
  • If you have a comfyui plugin or custom_nodes, it will check all the requirements from node git directors, and install all miss packages.

My advice Make sure that all projects run under an independent environment separately. In my experience, conda is better than venv

Hi FavorMyLikes, thanks a lot for the feedback! Unfortunately I'm really not a pyton/terminal guy.. I'm using a Mac M1 and I think I'm using conda (but who knows? :( ) . I start comfyui with this code:

cd ComfyUI python main.py --force-fp16

I have some custom nodes

Untill recently everything was working good, then I don't know what happened (maybe updating) to cause this problem that cause controlnet and other custom nodes to stop working. I see messages like: Cannot import /Users/../ComfyUI/custom_nodes/comfyui_controlnet_aux module for custom nodes: module 'cv2.gapi.wip.draw' has no attribute 'Text'

Any help will be much appreciated :(

conda and venv are two useful Python environment managers, you can just type conda activate some_name into an independent environment, it's a good habit before you start your comfyui.

Here are some introductions.

Matt-V50 avatar Dec 08 '23 13:12 Matt-V50

Hi, the command works for me, but when I restart ComfyUI the next day the problem comes back.. And I have to launch the fix command again for it to work... Is it normal? How to fix it permanently? Thank you

@riccardobiagi I'm not very sure, maybe it depends on the way how you use comfyui. Here are some of my guesses

  • Docker environment

    • If you restart it with some command like docker composer up --build, it will recreate the whole docker environment.
  • If you have a comfyui plugin or custom_nodes, it will check all the requirements from node git directors, and install all miss packages.

My advice Make sure that all projects run under an independent environment separately. In my experience, conda is better than venv

Hi FavorMyLikes, thanks a lot for the feedback! Unfortunately I'm really not a pyton/terminal guy.. I'm using a Mac M1 and I think I'm using conda (but who knows? :( ) . I start comfyui with this code: cd ComfyUI python main.py --force-fp16 I have some custom nodes Untill recently everything was working good, then I don't know what happened (maybe updating) to cause this problem that cause controlnet and other custom nodes to stop working. I see messages like: Cannot import /Users/../ComfyUI/custom_nodes/comfyui_controlnet_aux module for custom nodes: module 'cv2.gapi.wip.draw' has no attribute 'Text' Any help will be much appreciated :(

conda and venv are two useful Python environment managers, you can just type conda activate some_name into an independent environment, it's a good habit before you start your comfyui.

Here are some introductions.

Thank you man, I'll check it out!

riccardobiagi avatar Dec 11 '23 09:12 riccardobiagi