diffusers
diffusers copied to clipboard
Better error message for unsupported classes
Case in point: attempting to load a pipeline that uses the k-LMS scheduler using from_pretrained without scipy installed fails here because load_method_name is None. The error the user sees is:
Traceback (most recent call last):
File "app.py", line 7, in <module>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/diffusers/pipeline_utils.py", line 457, in from_pretrained
load_method = getattr(class_obj, load_method_name)
TypeError: getattr(): attribute name must be string