cantrell / stable-diffusion-api-server

A local API server on top of Stable Diffusion.
Apache License 2.0
356 stars 61 forks source link

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

Open franciscocabral opened 1 year ago

franciscocabral commented 1 year ago

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

bizbazboz commented 11 months ago

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```