ZHO-ZHO-ZHO / ComfyUI-YoloWorld-EfficientSAM

Unofficial implementation of YOLO-World + EfficientSAM for ComfyUI
GNU General Public License v3.0
598 stars 55 forks source link

No module named 'inference' when installing on macOS #4

Open alessandroperilli opened 7 months ago

alessandroperilli commented 7 months ago

Hi. Thanks for this new great custom node!

The node suite, installed it via ComfyUI Manager, fails to import due to the following error:

File "/ComfyUI/nodes.py", line 1887, 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 "/ComfyUI/custom_nodes/ComfyUI-YoloWorld-EfficientSAM/init.py", line 1, in from . import YOLO_WORLD_EfficientSAM File "/ComfyUI/custom_nodes/ComfyUI-YoloWorld-EfficientSAM/YOLO_WORLD_EfficientSAM.py", line 9, in from inference.models import YOLOWorld ModuleNotFoundError: No module named 'inference'

Cannot import /ComfyUI/custom_nodes/ComfyUI-YoloWorld-EfficientSAM module for custom nodes: No module named 'inference'

I believe this is because I am on Apple M2 and the requirement.txt is looking for an inference-gpu package that is not available for macOS.

As I read on PyPI, perhaps the requirement can be modified to also install the inference package?

Thank you

huangqiaobo commented 6 months ago

after run pip install interence get new error: ImportError: cannot import name 'YOLOWorld' from 'inference.models'

edit YOLO_WORLD_EfficientSAM.py can resolve the error

- from inference.models import YOLOWorld
+ from inference.models.yolo_world import YOLOWorld

then get new error

ModuleNotFoundError: No module named 'clip'
module 'clip' has no attribute 'clip'

fix it

pip install git+https://github.com/openai/CLIP.git
LiMingHuaGit commented 6 months ago

As a complement, edit requirements.txt to

inference[yolo-world]==0.9.20

and edit YOLO_WORLD_EfficientSAM.py can resolve the error

- from inference.models import YOLOWorld
+ from inference.models.yolo_world import YOLOWorld

and run

pip install -r requirements.txt