TinyTerra / ComfyUI_tinyterraNodes

A selection of nodes for Stable Diffusion ComfyUI
GNU General Public License v3.0
341 stars 41 forks source link

Rembg installation causes onnxruntime-gpu error on M2 systems #75

Closed alessandroperilli closed 8 months ago

alessandroperilli commented 8 months ago

In the last couple of days, the ttN suite has started attempts to install the rembg package. This, in turn, pushes the upgrade of numpy to version 1.26, which is incompatible with WAS Node Suite.

Plus, the package causes other errors on my machine (Apple M2):

Screenshot 2023-11-06 at 10 35 52

To fix this, I have to manually enter the ComfyUI venv, uninstall numpy and reinstall it at version 1.24.

Any change this can be reworked to avoid the incompatibility?

TinyTerra commented 8 months ago

remBG likes to cause issues.

I have updated d691190a175e774828eb8d0ee1604115ca1fa73e so that installing it is opt-in from the beginning.

alessandroperilli commented 8 months ago

It's a welcome change, thank you.

However, the update to this commit still caused numpy to update to version 1.26 (which I had to manually remove again). I checked the config.ini and the setting for rembg was: ALREADY INSTALLED

I changed it to FALSE and I hope that it fixes the problem for the future.

I wonder if others will be in the same situation and if this troubleshooting will be too complicated.

TinyTerra commented 8 months ago

Even if the config was ALREADY INSTALLED it should only attempt to install if the user specifically sets it to True.

Can you post the start-up log? Was it definitely ttN that was doing the install?

alessandroperilli commented 8 months ago

Almost certainly not, and I apologize for not checking more carefully before opening this issue (even if it helped solve the onnxruntime-gpu error).

The entire start-up log is too large to post, but these lines are relevant:

Requirement already satisfied: mpmath>=0.19 in xyz/ComfyUI/venv/lib/python3.11/site-packages (from sympy->torch>=1.7.0->ultralytics!=8.0.177->-r requirements.txt (line 1)) (1.3.0) Installing collected packages: numpy Attempting uninstall: numpy Found existing installation: numpy 1.24.0 Uninstalling numpy-1.24.0: Successfully uninstalled numpy-1.24.0 [!] Successfully installed numpy-1.26.1

The only node I actively use with an Ultralytics provider comes from the Impact Pack, so perhaps it's that?

By pure coincidence, every time I update the Impact Pack there's also a ttN update, and the ttN generated the onnxruntime error, so I carelessly assumed the wrong correlation.

TinyTerra commented 8 months ago

No stress :)

remBG has caused issues in the past, so having it be user prompted is probably for the best regardless

Might have to have a look through the requirements.txt of other custom nodes