stable-diffusion-api-server icon indicating copy to clipboard operation
stable-diffusion-api-server copied to clipboard

Error: cannot import name 'SAFE_WEIGHTS_NAME' from 'transformers.utils'

Open franciscocabral opened this issue 1 year ago • 1 comments

If someone is having error to run the Api Server

ImportError: cannot import name 'SAFE_WEIGHTS_NAME' from 'transformers.utils' ...

Update the "diffusers" --> "diffusers==0.12.1" at environment.yaml Than execute conda env update -f environment.yaml

More info at: https://github.com/CompVis/stable-diffusion/issues/627

franciscocabral avatar Apr 12 '23 23:04 franciscocabral

Thanks, but now i get another issue

Traceback (most recent call last):
  File "c:/Users/44778/Desktop/VideotoVideo/stable-diffusion-api-server/server.py", line 131, in <module>
    manager.add_engine( 'txt2img', EngineStableDiffusion( diffusers.StableDiffusionPipeline,        sibling=None ) )
  File "c:/Users/44778/Desktop/VideotoVideo/stable-diffusion-api-server/server.py", line 62, in __init__
    self.engine = pipe.from_pretrained( 'runwayml/stable-diffusion-v1-5', use_auth_token=hf_token.strip() )
  File "C:\Users\44778\anaconda3\envs\sd-api-server\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 683, in from_pretrained
    class_obj = getattr(library, class_name)
  File "C:\Users\44778\anaconda3\envs\sd-api-server\lib\site-packages\transformers\utils\import_utils.py", line 865, in __getattr__
    raise AttributeError(f"module {self.__name__} has no attribute {name}")
AttributeError: module transformers has no attribute CLIPImageProcessor```

bizbazboz avatar Oct 09 '23 17:10 bizbazboz