stable-diffusion-webui
stable-diffusion-webui copied to clipboard
Run on Intel MacBook Pro: RuntimeError: The MPS backend is supported on MacOS 12.3+..Current OS version can be queried using `sw_vers`
Describe the bug Install to my 2020 Intel MacBook Pro, then run the command:
python webui.py --precision full
Then stopped and return the error:
...
File "/Users/ppt/miniconda/envs/web-ui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 985, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
RuntimeError: The MPS backend is supported on MacOS 12.3+.Current OS version can be queried using `sw_vers`
(web-ui) ppt@pptdeMacBook-Pro stable-diffusion-webui %
To Reproduce Steps to reproduce the behavior:
- Install all the steps
- Run the command "python webui.py --precision full"
- See error
Additional context Add any other context about the problem here.
(web-ui) ppt@pptdeMacBook-Pro stable-diffusion-webui % python webui.py --precision full
Warning: caught expptception 'Torch not compiled with CUDA enabled', memory monitor disabled
WARNING:root:Pytorch pre-release version 1.13.0.dev20220922 - assuming intent to test it
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla' with 512 in_channels
Loading weights [7460a6fa] from /Users/ppt/Github/stable-diffusion-webui/models/Stable-diffusion/sd-v1-4.ckpt
Global Step: 470000
Traceback (most recent call last):
File "/Users/ppt/Github/stable-diffusion-webui/webui.py", line 78, in <module>
shared.sd_model = modules.sd_models.load_model()
File "/Users/ppt/Github/stable-diffusion-webui/modules/sd_models.py", line 152, in load_model
sd_model.to(shared.device)
File "/Users/ppt/miniconda/envs/web-ui/lib/python3.10/site-packages/pytorch_lightning/core/mixins/device_dtype_mixin.py", line 113, in to
return super().to(*args, **kwargs)
File "/Users/ppt/miniconda/envs/web-ui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 987, in to
return self._apply(convert)
File "/Users/ppt/miniconda/envs/web-ui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 639, in _apply
module._apply(fn)
File "/Users/ppt/miniconda/envs/web-ui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 639, in _apply
module._apply(fn)
File "/Users/ppt/miniconda/envs/web-ui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 639, in _apply
module._apply(fn)
[Previous line repeated 1 more time]
File "/Users/ppt/miniconda/envs/web-ui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 662, in _apply
param_applied = fn(param)
File "/Users/ppt/miniconda/envs/web-ui/lib/python3.10/site-packages/torch/nn/modules/module.py", line 985, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
RuntimeError: The MPS backend is supported on MacOS 12.3+.Current OS version can be queried using `sw_vers`
(web-ui) ppt@pptdeMacBook-Pro stable-diffusion-webui %
We don't support Intel Mac's unfortunately. You could try downgading to PyTorch 12.1 and seeing if it makes a difference but aside from that there's not much you could do
@dylancl Do you have any plans to support Intel MacbookPro? I've been looking at the code for Stable Diffusion for the past few days, and I found that this error occurred when the web-ui was loading the model. It was reported as an error directly. As long as you change some parameters of the load function, you should be able to succeed, however, I am not familiar with the code for Stable Diffusion and pytorch, now is the first contact, it may take some time. In theory, Stable Diffusion and pytorch should be able to support Intel MacbookPro by adding some processing logic for it in the original code. I'm referring to some of the branches that already work on Apple's system.
@dylancl Do you support M1 MacBookPro?
It looks like the new version can support old macbook pro and new M1/M2 model