Live data from Hacker News

Run Stable Diffusion on Your M1 Mac’s GPU

replicate.com

101–110 of 415 posts

Re: Run Stable Diffusion on Your M1 Mac’s GPU

#101
post #84

Earlier quoted context omitted.

On an M1 Pro 16GB it is taking a couple minutes for each image.

Is that the difference in graphics performance between the M1 and M1 Pro or did the other person do something wrong? 70-90 minutes seems nuts

Might be the RAM difference. RAM is shared between CPU and GPU on the M1 series processors.

Re: Run Stable Diffusion on Your M1 Mac’s GPU

#102
post #46

Any chance of this running on an M1 iPad Pro?

Probably another week or two. running on M1 iPad Pro needs to get out of PyTorch, possibly export the model either through TorchScript and then do onnx conversion. From what I found so far, not many of these conversions done (except the OpenVINO one maybe?).

Re: Run Stable Diffusion on Your M1 Mac’s GPU

#103
The difference between an M2 air (8gb/512gb) versus an M1 pro (16gb/1tb) is much more than I expected.

  * M1 pro (16gb/1tb) can run the model in around 3 minutes.
  * M2 air (8gb/512gb) takes ~60 minutes for the same model.
I knew there would be some throttling due to the m2 air's fanless model, but I had no idea it would be a 20x difference (albeit, the m1 pro does have double the RAM. I don't have any other macbooks to test this on).

Re: Run Stable Diffusion on Your M1 Mac’s GPU

#104

I'm working on getting this running. Instead of "venv/bin/activate" I had to run "source venv/bin/activate". And I got an error installing the requirements, fixed by running "pip install pyyaml" as a separate command.

Wow, I'm getting as low as 1.2 seconds per "step" (about a minute for a 512x512 image with default settings) on my 32 GB M1 laptop (2021, 16-inch).

Re: Run Stable Diffusion on Your M1 Mac’s GPU

#105
post #82
post #76

Earlier quoted context omitted.

Brilliant, thank you! I just got OP's setup working, but this seems much more user-friendly. Giving it a try now... EDIT: Got it working, with a couple of pre-requisite steps: 0. `rm` the existing `stable-diffusion` repo (assuming you followed OP's original setup) 1. Install `conda`, if you don't already have it: brew install --cask miniconda 2. Install the other build requirements referenced in OP's setup: brew inst…

Can you describe how you did (/ are doing) this? Do you now need to use conda (as opposed to OPs pip only version)?

See my edit for more info. (Just ironing out a couple of other issues I've found, so might update it again shortly)

Re: Run Stable Diffusion on Your M1 Mac’s GPU

#107
post #103

The difference between an M2 air (8gb/512gb) versus an M1 pro (16gb/1tb) is much more than I expected. * M1 pro (16gb/1tb) can run the model in around 3 minutes. * M2 air (8gb/512gb) takes ~60 minutes for the same model. I knew there would be some throttling due to the m2 air's fanless model, but I had no idea it would be a 20x difference (albeit, the m1 pro does have double the RAM. I don't have any other macbooks t…

I suspect the lack of RAM is the issue here.

Re: Run Stable Diffusion on Your M1 Mac’s GPU

#108
post #21

For those as keen as I am to try this out, I ran these steps, only to run into an error during the pip install phase: > ERROR: Failed building wheel for onnx I was able to resolve it by doing this: > brew install protobuf Then I ran pip install again, and it worked!

What kind of speed does this run at? Eg. How long to make a 512x512 image at standard settings?

Getting around 4 minutes per image on M1 MacBook Air 16GB

Re: Run Stable Diffusion on Your M1 Mac’s GPU

#110
post #103

The difference between an M2 air (8gb/512gb) versus an M1 pro (16gb/1tb) is much more than I expected. * M1 pro (16gb/1tb) can run the model in around 3 minutes. * M2 air (8gb/512gb) takes ~60 minutes for the same model. I knew there would be some throttling due to the m2 air's fanless model, but I had no idea it would be a 20x difference (albeit, the m1 pro does have double the RAM. I don't have any other macbooks t…

Unscientifically that puts the M1 Pro GPU at about 25% of the performance of a RTX 3080.

Not too shabby...

EDIT - this comment implies it's much faster: https://news.ycombinator.com/item?id=32679518

If that's correct then it's close to matching my 3080 (mobile).

Post reply on HN