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

Failure importing registry installed node due to custom node code dependent on case sensitive name #199

Open
1 of 2 tasks
yondonfu opened this issue Oct 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@yondonfu
Copy link

yondonfu commented Oct 18, 2024

Describe the bug
A clear and concise description of what the bug is.

Note: I think it is debatable whether this is a problem with registry installs using comfy-cli or whether it is problem with how the specific custom node is implemented, but I thought I'd open this issue to get some discussion going and am happy to move the issue to the most relevant repo if there is alignment. See Additional Context for how I fixed this locally and a summary understanding of why this problem occurs in the first place.

I installed the jovimetrix node from the registry by running:

comfy node registry-install jovimetrix

When I run comfy launch, the jovimetrix node(s) are not imported properly due to failures in its __init__.py:

2024-10-18 09:04:11.877 | WARNING  | jovimetrix:__init__:955 - list index out of range
2024-10-18 09:04:11.877 | WARNING  | jovimetrix:__init__:954 - module failed /Users/yondonfu/Development/ComfyUI/custom_nodes/jovimetrix/core/core/calc.py
2024-10-18 09:04:11.877 | WARNING  | jovimetrix:__init__:955 - list index out of range
2024-10-18 09:04:11.877 | WARNING  | jovimetrix:__init__:954 - module failed /Users/yondonfu/Development/ComfyUI/custom_nodes/jovimetrix/core/core/utility/batch.py
2024-10-18 09:04:11.877 | WARNING  | jovimetrix:__init__:955 - list index out of range
2024-10-18 09:04:11.877 | WARNING  | jovimetrix:__init__:954 - module failed /Users/yondonfu/Development/ComfyUI/custom_nodes/jovimetrix/core/core/utility/io.py
2024-10-18 09:04:11.877 | WARNING  | jovimetrix:__init__:955 - list index out of range
2024-10-18 09:04:11.877 | WARNING  | jovimetrix:__init__:954 - module failed /Users/yondonfu/Development/ComfyUI/custom_nodes/jovimetrix/core/core/utility/info.py
2024-10-18 09:04:11.877 | WARNING  | jovimetrix:__init__:955 - list index out of range
2024-10-18 09:04:11.878 | WARNING  | jovimetrix:__init__:954 - module failed /Users/yondonfu/Development/ComfyUI/custom_nodes/jovimetrix/core/utility/batch.py
2024-10-18 09:04:11.878 | WARNING  | jovimetrix:__init__:955 - list index out of range
2024-10-18 09:04:11.878 | WARNING  | jovimetrix:__init__:954 - module failed /Users/yondonfu/Development/ComfyUI/custom_nodes/jovimetrix/core/utility/io.py
2024-10-18 09:04:11.878 | WARNING  | jovimetrix:__init__:955 - list index out of range
2024-10-18 09:04:11.878 | WARNING  | jovimetrix:__init__:954 - module failed /Users/yondonfu/Development/ComfyUI/custom_nodes/jovimetrix/core/utility/info.py
2024-10-18 09:04:11.878 | WARNING  | jovimetrix:__init__:955 - list index out of range
2024-10-18 09:04:11.878 | INFO     | jovimetrix:__init__:988 - 0 nodes loaded

Import times for custom nodes:
   0.0 seconds: /Users/yondonfu/Development/ComfyUI/custom_nodes/websocket_image_save.py
   0.0 seconds: /Users/yondonfu/Development/ComfyUI/custom_nodes/jovimetrix

To Reproduce
Steps to reproduce the behavior

  1. Run comfy node registry-install jovimetrix
  2. Run comfy launch.
  3. Observe warnings and failure to import jovimetrix nodes.

Expected behavior
A clear and concise description of what you expected to happen.

I expect the jovimetrix nodes to be imported without any issue when running comfy launch after running comfy node registry-install jovimetrix.

Nice to have

  • Terminal output
  • Screenshots

Additional context
Add any other context about the problem here.

Environment

  • OS: macOS Sonoma 14.5
  • Device: Apple M1
  • comfy-cli version: 1.2.7

The Problem

The problem seems to be that there are a few places in the code for jovimetrix that assumes that the directory name for the base project is Jovimetrix:

  • 1
  • 2 and various other relative import statements.

The registry install by comfy-cli uses a case insensitive name (i.e. jovimetrix vs. Jovimetrix) and sets the directory name under custom_nodes to jovimetrix which causes these areas of the code to break.

The Temporary Fix

I was able to fix the warnings and import failure by renaming custom_nodes/jovimetrix within my ComfyUI directory to custom_nodes/Jovimetrix.

Future

AFAICT most other package managers use case insensitive package names so should the onus be on the custom node developer to ensure that their code is structured to work with case insensitive names? The concern would be if this causes backwards compat issues.

Or should a registry install by comfy-cli respect case sensitive names for repos and ensure that the directory name in custom_nodes is exactly the same as the repo name?

@yondonfu yondonfu added the bug Something isn't working label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant