runwayml / stable-diffusion

Latent Text-to-Image Diffusion

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImportError: cannot import name 'SAFE_WEIGHTS_NAME'

NirHeaven opened this issue · comments

when running with demo script, raise the error:
ImportError: cannot import name 'SAFE_WEIGHTS_NAME' from 'transformers.utils' (/root/anaconda3/envs/ldm/lib/python3.8/site-packages/transformers/utils/init.py)

the env is set up by README

Same issue here. It can be because of the diffusers version. The latest version is installed to the environment since the version is not specified in environment.yaml.

Downgrading the diffusers (e.g. 0.12.1) made it work.

pip install diffusers==0.12.1

More recent versions can also work but I haven't tried yet.