prompt-to-prompt icon indicating copy to clipboard operation
prompt-to-prompt copied to clipboard

Request for help, problems with the installation

Open alexte5173 opened this issue 2 years ago • 4 comments

Hello, I have tried to run this application, but it always gives me this error: TypeError Traceback (most recent call last) in 5 MAX_NUM_WORDS = 77 6 device = torch.device('cuda:0') if torch.cuda.is_available() else torch.device('cpu') ----> 7 ldm_stable = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", use_auth_token=MY_TOKEN).to(device) 8 tokenizer = ldm_stable.tokenizer

/usr/local/lib/python3.8/dist-packages/diffusers/pipeline_utils.py in from_pretrained(cls, pretrained_model_name_or_path, **kwargs) 371 load_method_name = importable_classes[class_name][1] 372 --> 373 load_method = getattr(class_obj, load_method_name) 374 375 loading_kwargs = {}

TypeError: getattr(): attribute name must be strin Could you please help me to solve it. Thank you in advance

alexte5173 avatar Dec 10 '22 01:12 alexte5173

I found it work that you can change the diffusers version to make sure it >=0.40.

landian60 avatar Dec 13 '22 09:12 landian60

añadir !pip install --upgrade diffusers transformers scipy

y correrá

uziel313 avatar Dec 13 '22 12:12 uziel313

@landian60 or @uziel313, How did you get past the other errors that happen after this? In #29 , I pointed at two of them:

  1. Setting the offset in ptp_utils.py L163 doesn't work with the newest diffusers.
  2. After turning off the offset kwarg above, I get TypeError: forward() got an unexpected keyword argument 'attention_mask'.

cinjon avatar Jan 05 '23 19:01 cinjon

Hello, I also encountered a similar problem. The error occurs because of version inconsistencies between diffusers, transformers, and pretrained weights ("CompVis/stable-diffusion-v1-4").

Here is my solution.

diffusers==0.3.0
transformers==4.24.0

For "CompVis/stable-diffusion-v1-4", we add "revision='249dd2d739844dea6a0bc7fc27b3c1d014720b28'" for the stable version.

ldm_stable = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", use_auth_token=MY_TOKEN, revision="249dd2d739844dea6a0bc7fc27b3c1d014720b28").to(device)

john12458 avatar May 17 '23 08:05 john12458