News for hackers. Stuff that matters.
Re:Run Stable Diffusion on Your M1 Mac’s GPU by jonplackett on Thursday September 01, 2022 @01:26PM (#32679848)
What kind of speed does this run at? Eg. How long to make a 512x512 image at standard settings?
Re:Run Stable Diffusion on Your M1 Mac’s GPU by pwinnski on Thursday September 01, 2022 @01:38PM (#32680046)
I haven't installed from this link specifically, but I used one of the branches on which this is based a few days ago, so the results should be similar.

On a first-gen M1 Mac mini with 8GB RAM, it takes 70-90 minutes for each image.

Still feels like magic, but old-school magic.

Re:Run Stable Diffusion on Your M1 Mac’s GPU by antihero on Thursday September 01, 2022 @01:55PM (#32680357)
On an M1 Pro 16GB it is taking a couple minutes for each image.
Re:Run Stable Diffusion on Your M1 Mac’s GPU by hbn on Thursday September 01, 2022 @02:02PM (#32680481)
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
Re:Run Stable Diffusion on Your M1 Mac’s GPU by pwinnski on Thursday September 01, 2022 @02:39PM (#32681003)
I have the M1 8GB I mentioned in my first comment, and the M1 Pro 16GB I mentioned in my second component, side-by-side. However, the first one was running a Stable Diffusion branch from earlier in the week, so I replaced using the same instructions. The only difference now is the physical hardware.

The thing to understand is that the 8GB M1 has 8GB. When I run txt2img.py, my Activity Monitor shows a Python process with 9.42GB of memory, and the "Memory Pressure" graph spends time in the red zone as the machine is swapping. While the 16GB M1 Pro immediately shows PLMS Sampler progress, and consistently spends around 3 seconds per iteration (e.g. "3.29s/it" and "2.97s/it"), the 8GB M1 takes several minutes before it jumps from 0% to 2% progress, and it accurately reports "326.24s/it"

So yes, whether it's M1 vs M1 Pro, or 8GB vs 16GB, it really is that stark a difference.

Update: after the second iteration it is 208.44s/it, so it is speeding up. It should drop to less than 120s/it before it finishes, if it runs as quickly as my previous install. And yes, 186.04s/it after the third iteration, and 159.22s/it after the fourth.

Re:Run Stable Diffusion on Your M1 Mac’s GPU by smoldesu on Thursday September 01, 2022 @03:16PM (#32681585)
Sounds entirely like a swap-constrained operation. You need ~8gb of VRAM to load the uncompressed model into memory, which obviously won't work well on a Macbook with 8gb of memory.
Re:Run Stable Diffusion on Your M1 Mac’s GPU by ralferoo on Thursday September 01, 2022 @03:20PM (#32681649)
My first-gen M1 MacBook Air with 16GB takes just under 4 minutes per image. Running top while it's generating shows memory usage fluctuating between 10GB and 13GB, so if you're running on 8GB it's probably swapping a lot.
Re:Run Stable Diffusion on Your M1 Mac’s GPU by nicoburns on Thursday September 01, 2022 @02:23PM (#32680776)
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 by mattkevan on Thursday September 01, 2022 @06:40PM (#32684303)
My 16gb M1 Air was initially taking 13 minutes for a 50 step generation. But when I closed all the open tabs and apps it went down to 3 minutes.

Looks like RAM drastically affects the speed.

Re:Run Stable Diffusion on Your M1 Mac’s GPU by Turing_Machine on Thursday September 01, 2022 @06:31PM (#32684231)
A little over three minutes on a first-gen M1 iMac with 16GB.

It looks like memory is super-important for this (which isn't all that surprising, really...).

Re:Run Stable Diffusion on Your M1 Mac’s GPU by pwinnski on Thursday September 01, 2022 @02:13PM (#32680628)
Installed from this link on a MacBook Pro (16-inch, 2021) with Apple M1 Pro and 16GB. First run downloads stuff, so I omit that result.

I had a YouTube video playing while I kicked off the exact command in the install docs, and got: 16.84s user 99.43s system 61% cpu 3:08.51 total

Next attempt, python aborted 78 seconds in! Weird.

Next attempt, with YouTube paused: 16.31s user 95.48s system 65% cpu 2:49.45 total

So around three minutes, I'd say.

Re:Run Stable Diffusion on Your M1 Mac’s GPU by moneycantbuy on Thursday September 01, 2022 @02:50PM (#32681177)
For 512x512 on M1 MAX (32 core) with 64 GB RAM I'm getting 1.67it/s so 30.59s with the default ddim_steps=50.
Re:Run Stable Diffusion on Your M1 Mac’s GPU by colaco on Thursday September 01, 2022 @02:55PM (#32681255)
I've gotten 1.35it/s that corresponds to 38s, but I've the M1 Max with the 24 cores GPU (the "lower end" one).
Re:Run Stable Diffusion on Your M1 Mac’s GPU by ponyous on Thursday September 01, 2022 @07:44PM (#32684846)
I just set up a similar thing on my own a bit differently than OP did.

Apple M1 Max with 10-core CPU, 32-core GPU, 16-core Neural Engine - Takes 38 seconds as well up to 46 when it gets hotter.

Can anyone give comparison with Nvida gpu in terms of performance?

Re:Run Stable Diffusion on Your M1 Mac’s GPU by jw1224 on Thursday September 01, 2022 @01:35PM (#32679994)
On my M1 Pro MBP with 16GB RAM, it takes ~3 minutes.
Re:Run Stable Diffusion on Your M1 Mac’s GPU by johnfn on Thursday September 01, 2022 @01:41PM (#32680109)
Looks like I'm getting around 4s per iteration on my M1 Max. At 50 iterations, that's 200 seconds.
Re:Run Stable Diffusion on Your M1 Mac’s GPU by _ph_ on Thursday September 01, 2022 @06:35PM (#32684259)
On my M2 Air, 16G, 10 CPU cores, the default command as in the installing instructions takes like 2m20s.
Re:Run Stable Diffusion on Your M1 Mac’s GPU by chime on Thursday September 01, 2022 @11:40PM (#32686323)
MacBook Air M2 8 CPU 8GB the example apple image took 35mins. Guess I'll wait for now.
Re:Run Stable Diffusion on Your M1 Mac’s GPU by NwpierratorR on Friday September 02, 2022 @04:49AM (#32688312)
You clearly doing something wrong as I get about 3 minutes per image on m1 mac mini.

But yeah, at this stage most of guides are early hacks and require individual tweaking. It is quite expected that people get varying results. I assume in a week or a month situation will get much better and much more user-friendly.

Re:Run Stable Diffusion on Your M1 Mac’s GPU by chemeng on Thursday September 01, 2022 @02:34PM (#32680945)
Getting around 4 minutes per image on M1 MacBook Air 16GB
Re:Run Stable Diffusion on Your M1 Mac’s GPU by dominicl on Friday September 02, 2022 @03:56AM (#32687915)
Hm, taking 2 hours on my M1 MacBook Air 16GB and it's clearly swapping. Are you using model v1.4? Or any other memory optimization that you applied?
Re:Run Stable Diffusion on Your M1 Mac’s GPU by whywhywhywhy on Thursday September 01, 2022 @01:57PM (#32680387)
M1 Max (32gb) is around 35 seconds per image.