zhongpei / Comfyui_image2prompt

image to prompt by vikhyatk/moondream1
GNU General Public License v3.0
243 stars 14 forks source link

Import Failed (Solved) #6

Closed Wraithnaut closed 4 months ago

Wraithnaut commented 5 months ago

Comfyui_image2prompt failed to import at first but applying the recent update through the Manager fixed it.

[2024-02-02 17:09] Traceback (most recent call last):
  File "/home/USERNAME/ComfyUI/nodes.py", line 1893, 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 "/home/USERNAME/ComfyUI/custom_nodes/Comfyui_image2prompt/__init__.py", line 1, in <module>
    from .image2text import Image2Text, LoadImage2TextModel
  File "/home/USERNAME/ComfyUI/custom_nodes/Comfyui_image2prompt/image2text.py", line 1, in <module>
    from .model import Image2TextModel
  File "/home/USERNAME/ComfyUI/custom_nodes/Comfyui_image2prompt/model.py", line 1160, in <module>
    from transformers import TextIteratorStreamer
ImportError: cannot import name 'TextIteratorStreamer' from 'transformers' (/home/USERNAME/ComfyUI/venv/lib64/python3.11/site-packages/transformers/__init__.py)
[2024-02-02 17:09] 
[2024-02-02 17:09] Cannot import /home/USERNAME/ComfyUI/custom_nodes/Comfyui_image2prompt module for custom nodes: cannot import name 'TextIteratorStreamer' from 'transformers' (/home/USERNAME/ComfyUI/venv/lib64/python3.11/site-packages/transformers/__init__.py)

I also updated ComfyUI to the latest release (2024/2/2) but this may or may not have been necessary.