Chaoses-Ib / ComfyScript

A Python frontend and library for ComfyUI
https://discord.gg/arqJbtEg7w
MIT License
431 stars 24 forks source link

Can't import plugin ,Error is: module 'ComfyScript.nodes.ComfyUI_Ib_CustomNodes' has no attribute 'NODE_CLASS_MAPPINGS' #7

Closed Erwin11 closed 11 months ago

Erwin11 commented 11 months ago

Installed the lastest version. had installed requirements.txt Error Info:

ComfyScript: Loading nodes...
Traceback (most recent call last):
  File "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1810, 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 "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyScript\__init__.py", line 20, in <module>
    NODE_CLASS_MAPPINGS.update(ComfyUI_Ib_CustomNodes.NODE_CLASS_MAPPINGS)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'ComfyScript.nodes.ComfyUI_Ib_CustomNodes' has no attribute 'NODE_CLASS_MAPPINGS'

Cannot import E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyScript module for custom nodes: module 'ComfyScript.nodes.ComfyUI_Ib_CustomNodes' has no attribute 'NODE_CLASS_MAPPINGS'
Adding E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\custom_nodes to sys.path

160413

Chaoses-Ib commented 11 months ago

Looks like you failed to clone the git submodule due to some reason.You can try to run this:

git -C "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyScript" submodule update --init --recursive

If this doesn't work, just delete directories under E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyScript\nodes.

Erwin11 commented 11 months ago

It works. My bad,how to install, I didn't see that very clearly

Chaoses-Ib commented 11 months ago

The installation section has given the command lines:

cd ComfyUI/custom_nodes
git clone --recurse-submodules https://github.com/Chaoses-Ib/ComfyScript.git
cd ComfyScript
python -m pip install -r requirements.txt

You may forgot --recurse-submodules when cloning the repo.

I'll add this to ComfyUI Manager to make the installation easier after some features are finished.

Chaoses-Ib commented 11 months ago

Now one should see this error message if the submodule is empty:

image

Erwin11 commented 11 months ago

yes ,I forgot to typing --recurse-submodules. Follow the readme.md, installation is OK.

Chaoses-Ib commented 10 months ago

Now nodes are installed as package dependencies instead of Git submodules. pip install -e . or pip install -r requirements.txt will install them. --recurse-submodules is no longer needed.