Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to load #52

Open
geoff-m opened this issue Feb 24, 2024 · 1 comment
Open

Fails to load #52

geoff-m opened this issue Feb 24, 2024 · 1 comment

Comments

@geoff-m
Copy link

geoff-m commented Feb 24, 2024

ComfyUI output during loading:

Traceback (most recent call last):
  File "S:\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1887, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "...\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_segment_anything\__init__.py", line 1, in <module>
    from .node import *
  File "...\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_segment_anything\node.py", line 17, in <module>
    from sam_hq.build_sam_hq import sam_model_registry
  File "...\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_segment_anything\sam_hq\build_sam_hq.py", line 13, in <module>
    from .modeling.tiny_vit import TinyViT
  File "...\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_segment_anything\sam_hq\modeling\tiny_vit.py", line 15, in <module>
    from timm.models.layers import DropPath as TimmDropPath,\
ModuleNotFoundError: No module named 'timm'

Cannot import ...\ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_segment_anything module for custom nodes: No module named 'timm'
@LukeG89
Copy link

LukeG89 commented Feb 27, 2024

Hi @geoff-m , I'm just a random person, but I can help you with your problem.

As I can see your ComfyUI path folder is really long. Try reducing it, I had problems having all that ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable my first time using Comfy. Maybe that is the cause of the problem.
Try remove at least the first folder to have S:\ComfyUI_windows_portable.
You can even rename it to S:\ComfyUI, shorter paths are always better.

This custom node is checking at every ComfyUI startup the requirements (I open myself an issue about that because is quite annoying), so it should automatically install the missing module timm. Maybe it didn't work because of the long path.

If reducing the path didn't fix the problem, you can install that specific missing module by opening the terminal from the main ComfyUI folder and using this script to install it:

python_embeded/python.exe -m pip install timm

Or to install all the requirements (edit the path if needed):

python_embeded/python.exe -s -m pip install -r S:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_segment_anything\requirements.txt

I hope I helped you with your issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants