toyxyz / ComfyUI_toyxyz_test_nodes

Custom node and script for sending webcam to ComfyUI
GNU General Public License v3.0
460 stars 29 forks source link

run.bat does not execute #42

Open huru0510 opened 1 week ago

huru0510 commented 1 week ago

After I install the setup.bat and the venv folder appears, I click on run.bat and the command window briefly opens and closes.

Is there any solution to this problem?

Zach-Wendt commented 1 week ago

Had this same problem.

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last): File "W:\AI\Comfy\ComfyUI\custom_nodes\ComfyUI_toyxyz_test_nodes\CaptureCam\cam.py", line 1, in <module>
import cv2
File "W:\AI\Comfy\ComfyUI\custom_nodes\ComfyUI_toyxyz_test_nodes\CaptureCam\venv\Lib\site-packages\cv2_init_.py", line 181, in <module>
bootstrap()
File "W:\AI\Comfy\ComfyUI\custom_nodes\ComfyUI_toyxyz_test_nodes\CaptureCam\venv\Lib\site-packages\cv2_init_.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
File "C:\Users\blah\AppData\Local\Programs\Python\Python311\Lib\importlib_init_.py", line 126, in import_module
return bootstrap.gcd_import(name[level:], package, level)
AttributeError: ARRAY_API not found
Traceback (most recent call last):
File "W:\AI\Comfy\ComfyUI\custom_nodes\ComfyUI_toyxyz_test_nodes\CaptureCam\cam.py", line 1, in <module>
import cv2
File "W:\AI\Comfy\ComfyUI\custom_nodes\ComfyUI_toyxyz_test_nodes\CaptureCam\venv\Lib\site-packages\cv2_init.py", line 181, in <module>
bootstrap()
File "W:\AI\Comfy\ComfyUI\custom_nodes\ComfyUI_toyxyz_test_nodes\CaptureCam\venv\Lib\site-packages\cv2_init.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\blah\AppData\Local\Programs\Python\Python311\Lib\importlib_init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: numpy.core.multiarray failed to import

I had to navigate to the run.bat location and activate the venv

# open cmd, navigate to ComfyUI\custom_nodes\ComfyUI_toyxyz_test_nodes\CaptureCam directory
# this call command below activated the venv for me
call .\venv\Scripts\activate.bat python cam.py

Run

pip install numpy==1.23.5

Then

pip install --force-reinstall -r requirements.txt

This ended up not working so I finally ran:

pip install --upgrade opencv-python pillow mttkinter mss pywin32 pysimplegui pygrabber keyboard pygetwindow

And it worked! Good luck!

toyxyz commented 1 week ago

I fixed the problem, try updating to the latest version!