Live data from Hacker News

Stable Diffusion with Core ML on Apple Silicon

machinelearning.apple.com

41–50 of 184 posts

Re: Stable Diffusion with Core ML on Apple Silicon

#42
post #36

Earlier quoted context omitted.

Oh gosh that's an intimidating installation process. I'll be much more interested when I can just `brew install` a binary.

> Oh gosh that's an intimidating installation process I'm not seeing any installation instructions on either link - what am I missing?

All I had to do was:

- create a virtual environment (Python 3.8.15 worked best)

- upgrade pip

- pip install wheel

- pip install -r requirements.txt

- and then, python setup.py install

- Had to update my XCode to use the generated mlpackage files :/

- Expand drawer with instructions and follow them to download model and convert it to Core ML format

- Run their CLI command as mentioned

Re: Stable Diffusion with Core ML on Apple Silicon

#44
post #2

Atila from Apple on the expected performance: > For distilled StableDiffusion 2 which requires 1 to 4 iterations instead of 50, the same M2 device should generate an image in https://twitter.com/atiorh/status/1598399408160342039

Last nail in the coffin for DALL·E.

I think they can move upmarket just as well as anyone else.

Re: Stable Diffusion with Core ML on Apple Silicon

#45

Earlier quoted context omitted.

Oh gosh that's an intimidating installation process. I'll be much more interested when I can just `brew install` a binary.

A bit different take is DiffusionBee, if you're curious to try it out in a GUI form. https://diffusionbee.com

I’ve used this a fair amount but am not sure it’s much better place to begin than automatic1111, especially for the HN crowd.

Re: Stable Diffusion with Core ML on Apple Silicon

#46
post #12

Earlier quoted context omitted.

SD2 is the one that was neutered, right? Maybe a dumb question but can the old model still be run?

Also, can you not "upgrade" but still run new models?

You can do anything you want.

SD2 wasn’t “neutered”, the piece of it from OpenAI that knew a lot of artist names but wasn’t reproduceable was replaced with a new one from Stability that doesn’t. You can fine-tune anything you want back in.

Re: Stable Diffusion with Core ML on Apple Silicon

#47

Great stuff. I like that they give directions for both Swift and Python This gets you text descriptions to images. I have seen models that given a picture, then generate similar pictures. I want this because while I have many pictures of my grandmothers, I only have a couple of pictures of my grandfathers and it would be nice to generate a few more. Core ML is so well done. A year ago I wrote a book on Swift AI and u…

That’s DreamBooth. There are some services that will do it for you.

Re: Stable Diffusion with Core ML on Apple Silicon

#48

Man, this takes a ton of room to do the CoreML conversions - ran out of space doing the unet conversion even though I started with 25GB free. Going on a delete spree to get it up to 50GB free before trying again.

How much space do you have and how much do you try to keep free? I get freaked out if I have less than 400gb free.

Re: Stable Diffusion with Core ML on Apple Silicon

#49
post #14

Earlier quoted context omitted.

With the full 50 iterations it appears to be about 30s on M1. They have some benchmarks on the github repo: https://github.com/apple/ml-stable-diffusion For reference, previously I was getting about <3 minutes for 50 iterations on my Macbook Air M1. I haven't yet tried Apple's implementation but it looks like a huge improvement. It might take it from "possible" to "usable".

For comparison, it's also taking ~3min @ 50 iterations on my 12c Threadripper using OpenVino. It sounds like the improvements bring the M1 performance roughly in line with a GTX 1080.

I have Macbook Air M1, which is passively cooled. When cooled properly, that is thermal pad mod combined with a fan under the laptop, I'm getting closer to 2min - something like 2.8s per iteration. I guess it would be something 140s for 50 iterations on a MacBook Pro or Mac mini for M1.

Re: Stable Diffusion with Core ML on Apple Silicon

#50
post #14

Earlier quoted context omitted.

With the full 50 iterations it appears to be about 30s on M1. They have some benchmarks on the github repo: https://github.com/apple/ml-stable-diffusion For reference, previously I was getting about <3 minutes for 50 iterations on my Macbook Air M1. I haven't yet tried Apple's implementation but it looks like a huge improvement. It might take it from "possible" to "usable".

For comparison, it's also taking ~3min @ 50 iterations on my 12c Threadripper using OpenVino. It sounds like the improvements bring the M1 performance roughly in line with a GTX 1080.

The Apple Neural Engine in the m1 is supposed to be able to perform 11 tops. The GTX 1080 about 9-11 tflops.

So sounds plausible that the m1 can reach the same level in some use cases with the right optimizations.

Post reply on HN