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

Error running node if Comfy not installed in a directory called "ComfyUI" #11

Closed
cliffrowley opened this issue Dec 4, 2023 · 3 comments

Comments

@cliffrowley
Copy link

I'm running ComfyUI in a docker container, where it's installed in /app. Installing this node throws the following error:

comfyui-app-1  | Traceback (most recent call last):
comfyui-app-1  |   File "/app/nodes.py", line 1800, in load_custom_node
comfyui-app-1  |     module_spec.loader.exec_module(module)
comfyui-app-1  |   File "<frozen importlib._bootstrap_external>", line 883, in exec_module
comfyui-app-1  |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
comfyui-app-1  |   File "/app/custom_nodes/ComfyUI-0246/__init__.py", line 1, in <module>
comfyui-app-1  |     from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
comfyui-app-1  |   File "/app/custom_nodes/ComfyUI-0246/nodes.py", line 23, in <module>
comfyui-app-1  |     with utils0246.temp_dir(pathlib.Path(__file__).parent.parent.parent.parent.absolute() / "ComfyUI" / "custom_nodes"):
comfyui-app-1  |   File "/usr/lib/python3.10/contextlib.py", line 135, in __enter__
comfyui-app-1  |     return next(self.gen)
comfyui-app-1  |   File "/app/custom_nodes/ComfyUI-0246/utils.py", line 71, in temp_dir
comfyui-app-1  |     os.chdir(new_dir)
comfyui-app-1  | FileNotFoundError: [Errno 2] No such file or directory: '/ComfyUI/custom_nodes'
comfyui-app-1  |
comfyui-app-1  | Cannot import /app/custom_nodes/ComfyUI-0246 module for custom nodes: [Errno 2] No such file or directory: '/ComfyUI/custom_nodes'

I believe it's because of this line, which incorrectly assumes the installation directory name:

with utils0246.temp_dir(pathlib.Path(__file__).parent.parent.parent.parent.absolute() / "ComfyUI" / "custom_nodes"):

Perhaps instead, you could go up one fewer parents, and then you wouldn't need to know the name of the installation directory?

@Trung0246
Copy link
Owner

Just changed the dir path. Hopefully nothing breaks.

@cliffrowley
Copy link
Author

cliffrowley commented Dec 5, 2023

Lovely, I'll give it a try - thanks for your speedy response!

@cliffrowley
Copy link
Author

Works perfectly. What an incredible node. Literally my favourite thing for organisation - well done!

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