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

Use relative path for custom/extra node module name #3944

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

huchenlei
Copy link
Collaborator

Related PR: #3943

Previously the module name of imported custom node is set as filename / directoryname, which can cause potential name conflict.

Imagine you have both comfy_extras/audio_nodes.py and custom_nodes/audio_nodes/. They both resolve to the same module name audio_nodes which can cause issue.

This PR makes module name relative path to the ComfyUI root folder so that this situation does not happen.

I can add some unit tests if the unit test infrastructure setup in #3897 is merged.

@huchenlei huchenlei changed the title Use relative path for module name Use relative path for custom/extra node module name Jul 4, 2024
@comfyanonymous comfyanonymous merged commit 0e3dfd9 into comfyanonymous:master Jul 5, 2024
2 checks passed
@comfyanonymous
Copy link
Owner

Had to revert this because it broke some imports like:

import comfy_extras.nodes_model_merging

@huchenlei
Copy link
Collaborator Author

Had to revert this because it broke some imports like:

import comfy_extras.nodes_model_merging

Issue confirmed.

@huchenlei huchenlei deleted the module_name_rework branch July 5, 2024 13:46
@huchenlei
Copy link
Collaborator Author

Tested #3943 is good. Can you merge that one instead?

csokun pushed a commit to csokun/ComfyUI that referenced this pull request Jul 10, 2024
)

* Fix module name for comfy extra nodes

* Use module name relative to root dir
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

Successfully merging this pull request may close these issues.

2 participants