zhongpei / Comfyui_image2prompt

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

Cannot import name 'ToImage' #3

Closed sblorg77 closed 4 months ago

sblorg77 commented 5 months ago

I really would like to use this, but are there any requirements for Torch? Maybe there is something missing in my setup, but I'm getting a message "cannot import name ToImage from torchvision.transforms.v2" with Torchvision 0.15.2 (sadly, I'm stuck with the old cu118 portable version of ComfyUI).

zhongpei commented 5 months ago

try this version

pip install torchvision==0.16.0
jmilez commented 5 months ago

I tried the upgrade to 0.16.0 and still get the op's error. during install got this error message...

Installing collected packages: torch, torchvision Attempting uninstall: torch Found existing installation: torch 2.0.1+cu118 Uninstalling torch-2.0.1+cu118: Successfully uninstalled torch-2.0.1+cu118 Attempting uninstall: torchvision Found existing installation: torchvision 0.15.2+cu118 Uninstalling torchvision-0.15.2+cu118: Successfully uninstalled torchvision-0.15.2+cu118

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. xformers 0.0.21 requires torch==2.0.1, but you have torch 2.1.0 which is incompatible. torchaudio 2.0.2+cu118 requires torch==2.0.1, but you have torch 2.1.0 which is incompatible.

Successfully installed torch-2.1.0 torchvision-0.16.0

proteus2000 commented 4 months ago

same problem here