Commit 2dff9da no longer constructs a diffusers pipeline using from_pretrained

#23
by hmillerbakewell - opened

Expected behaviour

The following code should set up a diffusion pipeline

import diffusers # diffusers==0.4.1
pipe = diffusers.StableDiffusionPipeline.from_pretrained(
    "hakurei/waifu-diffusion", 
    use_auth_token=True)

(Note that the README doesn't include the "hakurei" part of the repo identifier, which is a separate issue.)

Observed behaviour

Instead I get the error

File /mnt/g/experiments/stable-diffusion/.venv/lib/python3.8/site-packages/diffusers/pipeline_utils.py:457, in DiffusionPipeline.from_pretrained(cls, pretrained_model_name_or_path, **kwargs)
    454     if issubclass(class_obj, class_candidate):
    455         load_method_name = importable_classes[class_name][1]
--> 457 load_method = getattr(class_obj, load_method_name)
    459 loading_kwargs = {}
    460 if issubclass(class_obj, torch.nn.Module):

TypeError: getattr(): attribute name must be string

Last worked

Since this code used to work I checked the recent revisions:

import diffusers # diffusers==0.4.1
pipe = diffusers.StableDiffusionPipeline.from_pretrained(
    "hakurei/waifu-diffusion", revision="d135a7f19e2d1480428b1d92057f723811466ebb", 
    use_auth_token=True)

Which works as expected, but changing to revision 2dff9dab944d77470b545a1bbe86fffb08d54912 gives the error reported above.

Do you have scipy installed?

Thank you - I was indeed missing scipy and this has fixed my problem

hmillerbakewell changed discussion status to closed

Sign up or log in to comment