-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Trying to run Stable Diffusion code with the default scheduler and it simply crashes out every single time with the following error:
Traceback (most recent call last):
File "/Users/fahim/Code/Python/sd-gui/test.py", line 6, in <module>
pipe = StableDiffusionPipeline.from_pretrained("stable-diffusion-v1-4").to(device)
File "/Users/fahim/miniconda3/envs/ml/lib/python3.9/site-packages/diffusers/pipeline_utils.py", line 517, in from_pretrained
loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
File "/Users/fahim/miniconda3/envs/ml/lib/python3.9/site-packages/transformers/modeling_utils.py", line 1843, in from_pretrained
model = cls(config, *model_args, **model_kwargs)
TypeError: __init__() got an unexpected keyword argument 'device_map'
Reproduction
Just run the following code:
import torch
from diffusers import StableDiffusionPipeline
device = torch.device("cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu")
pipe = StableDiffusionPipeline.from_pretrained("stable-diffusion-v1-4").to(device)
prompt = "an elf sitting on a toadstool"
result = pipe(prompt)
image = result["sample"][0]
Logs
No response
System Info
macOS Monterey 12.6
Apple M1 Max 32GB
diffusers 0.5.1
dkackman
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working