Live data from Hacker News

Run Stable Diffusion on Your M1 Mac’s GPU

replicate.com

311–320 of 415 posts

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

#311

Earlier quoted context omitted.

> Also, interesting/curious small note: images generated with this script are "invisibly watermarked" i.e. steganographied! Why?

So that future iterations of StableDiffusion (or similar models) don't end up getting trained on their own outputs.

Oh wow, I didn't even think of that. I am pretty sure a few of the repo's have turned off the invisible watermark, I wonder if that will have consequences down the line for training data.

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

#312
post #269

Earlier quoted context omitted.

I ran into: ImportError: cannot import name 'TypeAlias' from 'typing' (/opt/homebrew/Caskroom/miniconda/base/envs/ldm/lib/python3.9/typing.py)

I followed the conda instruction which uses Python 3.9 and ran into the same issue. The workaround is to import TypeAlias from typing_extensions: stable-diffusion/src/k-diffusion/k_diffusion/sampling.py (before) from typing import Optional, Callable, TypeAlias (after) from typing import Optional, Callable from typing_extensions import TypeAlias This issue is tracked in https://github.com/lstein/stable-diffusion/issue…

you can also just change the python version in the yml file to 3.10.4 and it'll work

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

#313

Magnusviri[0], the original author of the SD M1 repo credited in this article, has merged his fork into the Lstein Stable Diffusion fork. You can now run the Lstein fork[1] with M1 as of a few hours ago. This adds a ton of functionality - GUI, Upscaling & Facial improvements, weighted subprompts etc. This has been a big undertaking over the last few days, and I highly recommend checking it out. See the mac m1 readme…

What's the performance of these models ,how much pc spec required for sane operation?

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

#314

Everyone posting their pip/build/runtime errors is everything that's wrong with tooling built on top of python and its ecosystem. It would be nice to see the ML community move on to something that's actually easily reproducible and buildable without "oh install this version of conda", "run pip install for this package", "edit this line in this python script".

I found a pretty great Docker image for the SD webui. I was forced to extreme measures since NixOS isn't super friendly with Conda (and I was particularly lazy). Worked out fine in the end, though. Highly recommended if you're on an Nvidia rig: https://github.com/AbdBarho/stable-diffusion-webui-docker

Docker the silver bullet /s

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

#317
post #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…

My 3170Ti will create 512x512 image in about 5-6 seconds with 50 inference steps

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

#318
post #89
post #35

Are we being pranked? I just followed the steps but the image output from my prompt is just a single frame of Rick Astley... EDIT: It was a false-positive (honest!) on the NSFW filter. To disable it, edit txt2img.py around line 325. Comment this line out: x_checked_image, has_nsfw_concept = check_safety(x_samples_ddim) And replace it with: x_checked_image = x_samples_ddim

Same thing happened to me which is especially odd as I literally just pasted the example command.

It has a lot of false positives. A lot of my portraits of faces were marked as NSFW. Possibly detecting proportion of the image that's skin color?

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

#319
post #90

Magnusviri[0], the original author of the SD M1 repo credited in this article, has merged his fork into the Lstein Stable Diffusion fork. You can now run the Lstein fork[1] with M1 as of a few hours ago. This adds a ton of functionality - GUI, Upscaling & Facial improvements, weighted subprompts etc. This has been a big undertaking over the last few days, and I highly recommend checking it out. See the mac m1 readme…

Nice. We'll get this guide updated for this fork. Everything's moving so fast it's hard to keep track! We struggled to get Conda working reliably for people, which it looks like lstein's fork recommends. I'll see if we can get it working with plain pip.

Conda is recommended because it starts from a clean environment so you're not debugging 13 other experiments the user has going on.

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

#320

It's insane to me how fast this is moving. I jumped through a bunch of hoops 2-3 days ago to get this running on my M1 Mac's GPU and now it's way easier. I imagine we will have a nice GUI (I'm aware of the web-ui, I haven't set it up yet) packaged in an mac .app by the end of next week. Really cool stuff.

I hope this kickstarts some kind of M1 migration. There are so many ML projects I'd like to try, but they all depend on CUDA.

I'd rather see something more platform agnostic. I'm sad OpenCL isn't a bigger success.
Post reply on HN