zhongpei / Comfyui_image2prompt

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

Doesn't install - " import name 'TextIteratorStreamer' from 'transformers" #1

Closed stephantual closed 7 months ago

stephantual commented 8 months ago

Hello! this is very exiciting, but sadly it doesn't install. I tried manual and comfyui manager, neither work. it seems that it's an incompatibility created by updates that happened post release of this node set.

The full error message on install is this:


Traceback (most recent call last):
  File "C:\AI\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1872, 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 "C:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui_image2prompt\__init__.py", line 1, in <module>
    from .image2text import Image2Text, LoadImage2TextModel
  File "C:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui_image2prompt\image2text.py", line 1, in <module>
    from .model import Image2TextModel
  File "C:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\Comfyui_image2prompt\model.py", line 1160, in <module>
    from transformers import TextIteratorStreamer
ImportError: cannot import name 'TextIteratorStreamer' from 'transformers' (C:\AI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\transformers\__init__.py)

Thank you for any help - yoru node set could be very useful to automate certain tasks, such as background replacement and auto-segmenting.

Thank you.

zhongpei commented 8 months ago

It may be a version problem,you can try

pip install transformers==4.37.2
stephantual commented 8 months ago

Thank you gong to try this and revert back to you. I have to shooot a tutorial video so the environement is frozen for the next 8h, i'll post when i'm finished. Thanks again.