Kosinkadink / ComfyUI-VideoHelperSuite

Nodes related to video workflows
GNU General Public License v3.0
583 stars 100 forks source link

VHS_VideoCombine fails to import #77

Open Animalgel opened 11 months ago

Animalgel commented 11 months ago

When launching comfyui portable on windows 11 with everything up to date:

ComfyUI web interface: "When loading the graph, the following node types were not found: VHS_VideoCombine Nodes that have failed to load will show as red on the graph."

Command window:

Traceback (most recent call last): File "C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1798, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite__init.py", line 1, in from .videohelpersuite.nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS File "C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite\videohelpersuite\nodes.py", line 15, in from .load_video_nodes import LoadVideoUpload, LoadVideoPath File "C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite\videohelpersuite\load_video_nodes.py", line 5, in import cv2 File "C:\Stable_Diffusion\ComfyUI_windows_portable\python_embeded\Lib\site-packages\cv2__init.py", line 181, in bootstrap() File "C:\Stable_Diffusion\ComfyUI_windows_portable\python_embeded\Lib\site-packages\cv2__init.py", line 175, in bootstrap if load_extra_py_code_for_module("cv2", submodule, DEBUG): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Stable_Diffusion\ComfyUI_windows_portable\python_embeded\Lib\site-packages\cv2\init.py", line 28, in load_extra_py_code_for_module py_module = importlib.import_module(module_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "importlib__init__.py", line 126, in import_module File "C:\Stable_Diffusion\ComfyUI_windows_portable\python_embeded\Lib\site-packages\cv2\typing\init__.py", line 157, in Prim = typing.Union[cv2.gapi.wip.draw.Text, cv2.gapi.wip.draw.Circle, cv2.gapi.wip.draw.Image, cv2.gapi.wip.draw.Line, cv2.gapi.wip.draw.Rect, cv2.gapi.wip.draw.Mosaic, cv2.gapi.wip.draw.Poly] ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'cv2.gapi.wip.draw' has no attribute 'Text'

Cannot import C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite module for custom nodes: module 'cv2.gapi.wip.draw' has no attribute 'Text'

Import times for custom nodes: 0.0 seconds: C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Advanced-ControlNet 0.0 seconds: C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-animatediff 0.0 seconds: C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved 0.0 seconds: C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Frame-Interpolation 0.0 seconds (IMPORT FAILED): C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite 0.0 seconds: C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy 0.1 seconds: C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Stable-Video-Diffusion 0.2 seconds: C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_FizzNodes 0.2 seconds: C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Styles 0.3 seconds: C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager 0.7 seconds: C:\Stable_Diffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node

Tried uninstalling and reinstalling from the comfyUI manager... Manually deleted the 'ComfyUI-VideoHelperSuite' folder and reinstalled...

image

maestroh commented 11 months ago

I've got the same problem. I have a fresh version of comfy installed with only the reactor and VHS plugins. I believe the problem is the version of opencv installed with reactor. See here for some details and a possible solution. https://github.com/Gourieff/comfyui-reactor-node/issues/112

Haven't tried this solution yet so not sure if it works.

icequake1969 commented 11 months ago

Same problem here. If you disable the Reactor node or this node, then it runs without error. Enable both and you get the error. Fresh Windows and Linux versions of Comfy also give the same exact error.

icequake1969 commented 11 months ago

Thanks Maestroh, that was the fix.

  1. Close ComfyUI if it runs
    1. Go to the ComfyUI root folder, open CMD there and run:
      • python_embeded\python.exe -m pip uninstall -y opencv-python opencv-contrib-python opencv-python-headless
      • python_embeded\python.exe -m pip install opencv-python==4.7.0.72
manducagiuseppe commented 11 months ago

Here's the solution

  1. Go to the ComfyUI main folder
  2. open the requirements.txt file and add
    • opencv-python
    • imageio-ffmpeg
  3. Save requirements.txt
  4. Click on update_comfyui_and_python_dependencies.bat

it worked for me

deimoslyric commented 11 months ago

Here's the solution

  1. Go to the ComfyUI main folder
  2. open the requirements.txt file and add

    • opencv-python
    • imageio-ffmpeg
  3. Save requirements.txt
  4. Click on update_comfyui_and_python_dependencies.bat

it worked for me

Thanks, this worked for me as well!

flov commented 11 months ago

I am having the same issue in my runpod. I tried what @icequake1969 wrote

pip uninstall -y opencv-python opencv-contrib-python opencv-python-headless
pip install opencv-python==4.7.0.72

but it hasn't worked so far

flov commented 11 months ago

I stand corrected, the changes worked, together with an installation of ffmpeg with apt-get install ffmpeg worked for me

HappyGitHubUser commented 11 months ago

Here's the solution

  1. Go to the ComfyUI main folder
  2. open the requirements.txt file and add

    • opencv-python
    • imageio-ffmpeg
  3. Save requirements.txt
  4. Click on update_comfyui_and_python_dependencies.bat

it worked for me

where it's update_comfyui_and_python_dependencies.bat ?

manducagiuseppe commented 11 months ago

Here's the solution

  1. Go to the ComfyUI main folder
  2. open the requirements.txt file and add

    • opencv-python
    • imageio-ffmpeg
  3. Save requirements.txt
  4. Click on update_comfyui_and_python_dependencies.bat

it worked for me

where it's update_comfyui_and_python_dependencies.bat ?

You can find it inside the update directory

cangzhen1 commented 11 months ago

Here's the solution

  1. Go to the ComfyUI main folder
  2. open the requirements.txt file and add

    • opencv-python
    • imageio-ffmpeg
  3. Save requirements.txt
  4. Click on update_comfyui_and_python_dependencies.bat

it worked for me

where it's update_comfyui_and_python_dependencies.bat ?

You can find it inside the update directory Why did my modification of requirements.txt not take effect?

tanobuffone commented 10 months ago

Here's the solution

  1. Go to the ComfyUI main folder
  2. open the requirements.txt file and add

    • opencv-python
    • imageio-ffmpeg
  3. Save requirements.txt
  4. Click on update_comfyui_and_python_dependencies.bat

it worked for me

Didn't worked at first because when it updates it rewrittes the requirements.txt , solution:

Bombyring commented 9 months ago

Go to the main Config UI folder open it requirements.txt file and add -opencv-python -imageio-ffmpeg Save requirements.txt Click on update_comfyui_and_python_dependencies.Did the ba method work? thanks

roecks commented 8 months ago

It worked for me. Even though I also uninstalled a ReActor custom node. Not sure whether that, or the additions to requirements.txt and updating ComfyUI worked.