laksjdjf / cgem156-ComfyUI

色々なカスタムノードを詰め込んだ。
GNU General Public License v3.0
49 stars 6 forks source link

Cannot Import into Custom Nodes #10

Closed yelnady closed 5 months ago

yelnady commented 5 months ago

I get the following error when trying to import cgem156-ComfyUI custom nodes using ComfyUI manager or Git Clone.

This is the error:

Traceback (most recent call last):
  File "/Users/yelnady/Data/ComfyUI/nodes.py", line 1879, 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 "/Users/yelnady/Data/ComfyUI/custom_nodes/cgem156-ComfyUI/__init__.py", line 35, in <module>
    module = importlib.import_module(f"custom_nodes.cgem156-ComfyUI.scripts.{script}")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/yelnady/.pyenv/versions/3.11.3/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/yelnady/Data/ComfyUI/custom_nodes/cgem156-ComfyUI/__init__.py", line 35, in <module>
    module = importlib.import_module(f"custom_nodes.cgem156-ComfyUI.scripts.{script}")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/yelnady/.pyenv/versions/3.11.3/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/yelnady/Data/ComfyUI/custom_nodes/cgem156-ComfyUI/scripts/dart/__init__.py", line 1, in <module>
    from .node import LoadDart, DartPrompt, DartConfig, DartGenerate, BanTags
  File "/Users/yelnady/Data/ComfyUI/custom_nodes/cgem156-ComfyUI/scripts/dart/node.py", line 2, in <module>
    from transformers.generation.logits_process import UnbatchedClassifierFreeGuidanceLogitsProcessor
ImportError: cannot import name 'UnbatchedClassifierFreeGuidanceLogitsProcessor' from 'transformers.generation.logits_process' (/Users/yelnady/.pyenv/versions/3.11.3/lib/python3.11/site-packages/transformers/generation/logits_process.py)

Cannot import /Users/yelnady/Data/ComfyUI/custom_nodes/cgem156-ComfyUI module for custom nodes: cannot import name 'UnbatchedClassifierFreeGuidanceLogitsProcessor' from 'transformers.generation.logits_process' (/Users/yelnady/.pyenv/versions/3.11.3/lib/python3.11/site-packages/transformers/generation/logits_process.py)

Thank you for the help!

laksjdjf commented 5 months ago

Latest transformers are required. Or if you don't need dart, deleting this line may solve the problem. https://github.com/laksjdjf/cgem156-ComfyUI/blob/af194b2725b3d0abf82ea2864e0cc287c858f0e6/__init__.py#L11

yelnady commented 5 months ago

Thanks updating transformers fixed it!