Live data from Hacker News

Running Stable Diffusion in 260MB of RAM

github.com

11–20 of 66 posts

Re: Running Stable Diffusion in 260MB of RAM

#11
post #3

That's really cool! I always thought you needed a good amount of GPU VRAM to generate images using SD. I wonder how fast would a consumer PC, with no GPU, generate an image with say 16gb of RAM?

On an Apple M1 with 16gig RAM, without using Pytorch compiled to take advantage of Metal, it could take 12mins to generate an image with a tweet-length prompt. With Metal, it takes less than 60 seconds.

Prompt length shouldn't influence creation time, at least it didn't in any of the implementations I used.

What is the resolution of your images and number of steps?

Re: Running Stable Diffusion in 260MB of RAM

#13

Incredible! If only there was some cheap hackable eink frame, you could make a fully self contained artwork from eink panel + rpi that's (slowly) continuously updating itself..!

There definitely are some: https://shop.pimoroni.com/search?q=e-ink

And now I think I know what my next project is going to be, I am sure I can find some desk space

Re: Running Stable Diffusion in 260MB of RAM

#15
post #6

Earlier quoted context omitted.

I was using a 6ish year old amd cpu with 16gigs of ram and generating a prompt would take about a half hour. Which is still massively impressive for what it is.

Use a free GPU from google colab and you can do the same in about 15 seconds...

Do you have a google colab link?

Re: Running Stable Diffusion in 260MB of RAM

#16

Incredible! If only there was some cheap hackable eink frame, you could make a fully self contained artwork from eink panel + rpi that's (slowly) continuously updating itself..!

There definitely are some: https://shop.pimoroni.com/search?q=e-ink And now I think I know what my next project is going to be, I am sure I can find some desk space

Yessss! I looked into building some self contained "slow tech" generative art using eink a couple of years ago but it was just impossible for my tiny budget. This is great, thanks!!

Edit..: I'm so hyped about this; the example image on TFA takes +2 hours to generate, but who cares?! I'd love to have a little display that churns around in the background and creates a new variation on my prompt every whatever hours, displaying the results on an unobtrusive eink screen.

Re: Running Stable Diffusion in 260MB of RAM

#17

Earlier quoted context omitted.

There definitely are some: https://shop.pimoroni.com/search?q=e-ink And now I think I know what my next project is going to be, I am sure I can find some desk space

Yessss! I looked into building some self contained "slow tech" generative art using eink a couple of years ago but it was just impossible for my tiny budget. This is great, thanks!! Edit..: I'm so hyped about this; the example image on TFA takes +2 hours to generate, but who cares?! I'd love to have a little display that churns around in the background and creates a new variation on my prompt every whatever hours, di…

Make sure you build in a capacity to save all the previous iterations in case you see something you really like.

Re: Running Stable Diffusion in 260MB of RAM

#18
post #6

Earlier quoted context omitted.

I was using a 6ish year old amd cpu with 16gigs of ram and generating a prompt would take about a half hour. Which is still massively impressive for what it is.

Use a free GPU from google colab and you can do the same in about 15 seconds...

yes, and if he does it on a paid machine with a better GPU it'll be even faster!

While true, neither your statement or mine above is germane to the discussion. It wasn't about how long it takes. It's a discussion of how cool it is that it can be done on that machine at all.

Re: Running Stable Diffusion in 260MB of RAM

#19
post #11
post #3

Earlier quoted context omitted.

On an Apple M1 with 16gig RAM, without using Pytorch compiled to take advantage of Metal, it could take 12mins to generate an image with a tweet-length prompt. With Metal, it takes less than 60 seconds.

Prompt length shouldn't influence creation time, at least it didn't in any of the implementations I used. What is the resolution of your images and number of steps?

Defaults from the Huggingface repo, just copy-pasted. So, iirc 50 steps and the image is 512x512.

Edit: confirmed.

> Prompt length shouldn't influence creation time...

Yeah, checks out with my experience too. Longer prompts were truncated.

Re: Running Stable Diffusion in 260MB of RAM

#20
post #17

Earlier quoted context omitted.

Yessss! I looked into building some self contained "slow tech" generative art using eink a couple of years ago but it was just impossible for my tiny budget. This is great, thanks!! Edit..: I'm so hyped about this; the example image on TFA takes +2 hours to generate, but who cares?! I'd love to have a little display that churns around in the background and creates a new variation on my prompt every whatever hours, di…

Make sure you build in a capacity to save all the previous iterations in case you see something you really like.

Haha I like the idea of walking past, glancing now and then to see if there's something you really love...

but on the other hand I would also love the statement behind something unconnected to the internet that's slowly churning out unique, ephemeral pictures. Yours to enjoy, then gone forever.

Post reply on HN