Live data from Hacker News

Run Stable Diffusion on Your M1 Mac’s GPU

replicate.com

291–300 of 415 posts

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

#291

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

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

#292
post #277

Earlier quoted context omitted.

Wow, that is over twice as fast as my Windows 11, RTX 3080ti

I just commented on another sibling comment (too late to edit the first one), but I forgot to mention my batch size is only 1. I think most people use batch size 4, so basically multiply my time by your batch size for a real comparison.

It was my bad, my script was still running a different fork. Seeing <10 second times with those parameters now. 13.6 seconds for an 3072 × 2048 upscaled image, which I'm particularly happy about.

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

#293

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 don't think this is particularly fair. This is literally hours old, and people installing now are really debugging rather than installing a "finished" build.

The forks are weird mashups of bits of repos, and running on a M1 GPU is something that barely works itself.

Give it maybe 3 months and it will be much smoother.

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

#294
post #288
post #47

Earlier quoted context omitted.

To be fair, the reason the filter is there is that if you ask for a picture of a woman, stable diffusion is pretty likely to generate a naked one! If you tweak the prompt to explicitly mention clothing, you should be OK though.

Wow, is that true? I’ve never heard a more textbook ethical problem with a model.

Safari blocking searches for "asian" probably had more impact: https://9to5mac.com/2021/03/30/ios-14-5-no-longer-blocks-web...

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

#296

Earlier quoted context omitted.

Just yesterday I read another comment on HN saying we will have to wait another decade before being able train it in someone "basement"( https://news.ycombinator.com/item?id=32658941 ). I made a bookmark for myself ( https://datum.alwaysdata.net/?explorer_view=quest&quest_id=q... ) to look for data that help estimate when it will be feasible to run Stable Diffusion "at home". I guess it's already outdated!

To run stable diffusion at home you have to download the model file, which took the equivalent of tens of thousands of hours spread across cloud provided GPUs. If the model file just vanished from everyone's hard drive one day, and cloud providers installed heuristics to detect and ban image dataset training, retraining the model file would actually take decades for any consumer, even an enthusiast with a dozen power…

You forget how much mark-up cloud providers charge.

I trained StyleGAN 2 from scratch using 8x 3090s at home and it took 3 months. It's fine.

240TB is small fish, my homelab is a petabyte and I consider it small.

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

#297
post #235

Earlier quoted context omitted.

Same output for me also. EDIT: https://github.com/lstein/stable-diffusion/issues/293#issuec... fixed it for me.

Boom - nice. Here's a fork with that: https://github.com/bfirsh/stable-diffusion/tree/lstein Requirements are "requirements-mac.txt" which'll need subbing in the guide. We're testing this out with a few people in Discord before shipping to the blog post.

Which Discord?

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

#298
For me:

    File "/Users/layer/src/stable-diffusion/venv/lib/python3.10/site-packages/torch/serialization.py", line 250, in __init__
      super(_open_file, self).__init__(open(name, mode))
    FileNotFoundError: [Errno 2] No such file or directory: 'models/ldm/stable-diffusion-v1/model.ckpt'
The directory is empty. Hmm.

I forgot to

    mv sd-v1-4.ckpt models/ldm/stable-diffusion-v1/model.ckpt
On a Mac Studio

    data: 100%|| 1/1 [00:43

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

#299
post #293

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 don't think this is particularly fair. This is literally hours old, and people installing now are really debugging rather than installing a "finished" build. The forks are weird mashups of bits of repos, and running on a M1 GPU is something that barely works itself. Give it maybe 3 months and it will be much smoother.

I think it is fair, actually. This is not unique to hours-old python projects, it's a common theme among almost all python tools I've used.

I have a suspicion that that something written in Julia, Go, Rust, or possibly even C wouldn't have nearly this many issues. I'm not talking about debugging the actual functionality of the software, but rather the environment and tooling surrounding the language and software built with it.

This project in particular should be an easy case because you know the hardware you'll be running on ahead of time.

I'm ranting a bit, but I've tried so many tools based on python and almost _none_ of them built/installed/ran correctly on the happy path laid out in each project's readme.

Anyway, sorry, rant over.

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

#300
post #296

Earlier quoted context omitted.

To run stable diffusion at home you have to download the model file, which took the equivalent of tens of thousands of hours spread across cloud provided GPUs. If the model file just vanished from everyone's hard drive one day, and cloud providers installed heuristics to detect and ban image dataset training, retraining the model file would actually take decades for any consumer, even an enthusiast with a dozen power…

You forget how much mark-up cloud providers charge. I trained StyleGAN 2 from scratch using 8x 3090s at home and it took 3 months. It's fine. 240TB is small fish, my homelab is a petabyte and I consider it small.

It would take you way longer to train something like GPT-3 with such a setup.
Post reply on HN