Live data from Hacker News

Run Stable Diffusion on Your M1 Mac’s GPU

replicate.com

11–20 of 415 posts

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

#11

Is there a way to get it to run on an an Intel-based Mac? I've attempted several times, but quickly ran into dependency issues and other quirks.

I believe the branch which adds support for Apple Silicon also adds support for running on Intel chips (albeit extremely slowly). I haven't tested it myself, but I've seen several people in the GitHub issues saying this.

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

#14

One beautiful thing I realized about all this progress in AI. We will still need people to do the hard yards, and get dirt between their fingernails. I am firmly in the camp of those people. Fancy algorithms won't dig holes, or lay out rail tracks of over hundreds of miles.. or build houses all across the world.

Are you following progress in robotics?

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

#15
Is there a good set of benchmarks available for Stable Diffusion? I was able to run a custom Stable Diffusion build on a GCE A100 instance (~$1/hour) at around 1Mpix per 10 seconds. I.e, I could create a 512x512 image in 2.5 seconds with some batching optimizations. A consumer GPU like a 3090 runs at ~1Mpix per 20 seconds.

I'm wondering what the price floor of stock art will be when someone can use https://lexica.art/ as a starting point, generate variations of a prompt locally, and then spend a few minutes sifting through the results. It should be possible to get most stock art or concept art at a price of <$1 per image.

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

#16
post #4

I'd rather see someone implemented glue that allows you to run arbitrary (deep learning) code on any platform. I mean, are we going to see X on M1 Mac, for any X now in the future? Also, weren't torch and tensorflow supposed to be this glue?

Broadly speaking, it looks like they are. The implementation of Stable Diffusion doesn't appear to be using all of those features correctly (i.e. device selection fails if you don't have CUDA enabled even though MPS (https://pytorch.org/docs/stable/notes/mps.html) is supported by PyTorch.

Similar goes for quirks of Tensorflow that weren't taken advantage of. That's largely the work that is on-going in the OSX and M1 forks.

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

#18
Between this and efforts to add 3D dimension to 2D images, I don’t see much of a future for digital multimedia creator jobs.

Even TikTok could be an endless stream of ML models.

Fears of a tech dystopia may be overblown; the masses will just shut off their gadgets and live simpler if labor markets implode within the traditional political correct economic system we have.

Open source AI is on the verge of upending the software industry and copyright. I dig it.

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

#19

Note: I ran this and haven't yet been able to get img2img working yet. I borked it up trying to get conda working. It's been a lot of fun to play with so far though!

Try the lstein fork: https://github.com/lstein/stable-diffusion/tree/fix-cuda-res...

You'll still need to play with modifying some of the code to get it to run, but `dream.py` works for me. Funny enough, I got only img2img effectively working with the lstein branch; it broke txt2img for me.

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

#20
post #13

How large an image will this handle (versus how much RAM you have)? It seems the GPU memory requirements beyond 512x512 are obscene.

I'm on a iMac M1 16gb and I can handle up to 768x768 but since it's shared memory I close out every other application and run things overnight.

The biggest issue with apple chips is that the --seed setting doesn't work. I should be able to set a seed to, for instance, 1083958 and if I re-run a command at the same resolution with that seed, I should get the same image every time. This would allow me to test different steps so I could generate a 100 images at 16 steps (which is quite fast) and pick the ones that are most promising and re-render at 64 or 128 steps.

But currently you can't do that on apple hardware because of an open issue in PyTorch. Genuinely hoping a fix comes soon, until it is this is more of a novelty than a tool on Apple hardware.

Post reply on HN