Live data from Hacker News

A Web UI for Stable Diffusion

github.com

71–80 of 148 posts

Re: A Web UI for Stable Diffusion

#71
post #17

So, and this is an ELI5 kind of question I suppose. There must be something going on like "processing a kazillion images" and I'm trying to wrap my head around how (or what part of) that work is "offloaded" to your home computer/graphics card? I just can't seem to make sense of how you can do it at home if you're not somehow in direct contact with "all the data?" e.g. must you be connected to the internet, or "stable…

You can think of it more like this: If I do 100 experiments of dropping stones at variable heights and measuring the time it takes for the stone to land on the ground I have enough datapoints to make a linear estimation of gravity by using linear regression. So based on my data I create a model that the time it takes for a stone to fall is sqrt(2h/9.81). Now if you want to figure out how long it takes for your stones…

This is exactly it. It’s pretty remarkable that it was trained on over 100 terabytes of images and yet the model has been distilled down to only 4gb.

Re: A Web UI for Stable Diffusion

#72
post #52

Earlier quoted context omitted.

That’s the interesting part: all the images generated are derived from a less than 4gb model (the trained weights of the neural network). So in a way, hundreds of billions of possible images are all stored in the model (each a vector in multidimensional latent space) and turned into pixels on demand (drived by the language model that knows how to turn words into a vector in this space) As it’s deterministic (given th…

So it's like a compiler which produces a 4GB executable file? And that 4GB is all the "logic" which can produce infinite possible images?

Not exactly. There’s no real logic per se, just data. It’s made up of tons of floating point numbers that define relationships to other floating point numbers.

Re: A Web UI for Stable Diffusion

#73
post #69

This is the one I've been using https://github.com/sd-webui/stable-diffusion-webui . docker-compose up , works great.

Is there a way to run this in the cloud? On Google Colab or elsewhere?

Colab: https://colab.research.google.com/github/WASasquatch/StableD...

To run it elsewhere in the cloud, grab a GPU (spot) instance and SSH in.

Re: A Web UI for Stable Diffusion

#74
post #49
post #48

Earlier quoted context omitted.

Midjourney uses SD under the hood (you can see in their license), but they augnment the model in various ways.

The results in midjourney are significantly better than SD. I find it much easier to get to a good result in MJ and I've been trying to understand why. Anymore insight you could share?

Midjourney takes their base models and does further training/guidance on them to bring out intentional aesthetic qualities. One of their main goals is to ensure that that their “default” style is beautiful no matter how simple the user’s prompt is.

Re: A Web UI for Stable Diffusion

#75
post #33

Regarding the opening image: if it can't correctly put the marks on dice, how can it put eyes, nose and mouth correctly on a human face?

It can’t. :) Well, I kid a bit. I’ve seen it produce some amazing results, but, generally, it has a hard time with that. Often faces end up looking blurry or having these creepy, dead white eyes. Hands likewise often end up malformed (seven fingers anyone?) and twisty. But, it seems to have a much easier time generating passable faces in close ups with the right key words. Especially if you give it an input image tha…

It’s worth noting you also get MUCH better faces and hands if you’re willing to run it for more steps (100-150). It takes a lot longer to run it at higher step counts so a lot of people don’t do it.

Re: A Web UI for Stable Diffusion

#76
post #71

Earlier quoted context omitted.

You can think of it more like this: If I do 100 experiments of dropping stones at variable heights and measuring the time it takes for the stone to land on the ground I have enough datapoints to make a linear estimation of gravity by using linear regression. So based on my data I create a model that the time it takes for a stone to fall is sqrt(2h/9.81). Now if you want to figure out how long it takes for your stones…

This is exactly it. It’s pretty remarkable that it was trained on over 100 terabytes of images and yet the model has been distilled down to only 4gb.

Then maybe we should remind about this 25,000:1 ratio when an artist complains about his copyrights being abused. The model doesn't have space to actually copy his works inside, it can only memorise the equivalent of a thumbnail from each input. A very small thumbnail, scaled down 150:1 per width and height (square root of 25000). That's like a grain of rice on the screen.

Re: A Web UI for Stable Diffusion

#77

a sigh of relief as I thought that this would generate instead of pictures, React UI code based on plain text description. First they came for illustrators, then they came for UI designers.

heh yeah it won’t be that long until we have A Stable Diffusion for Web UI

Re: A Web UI for Stable Diffusion

#78
post #69

Earlier quoted context omitted.

Is there a way to run this in the cloud? On Google Colab or elsewhere?

Colab: https://colab.research.google.com/github/WASasquatch/StableD... To run it elsewhere in the cloud, grab a GPU (spot) instance and SSH in.

You mean a VM on a machine with a GPU? Or does it have to be a bare metal machine? What is a good provider of suitable VMs/machines?

And what do you do after you SSHed in? The installation instructions seem to be for windows users (click here, then click there ...) is there a linux script that does the installation automatically?

Re: A Web UI for Stable Diffusion

#79

Earlier quoted context omitted.

I meant images generated by the model. Now that I think of it I could just send you the sampled vectors and you could feed that to the vector to image part.

My understanding is that images will not be bit identical due to GPU physics and decimal precision. Images from the same seed may be for all practical intents and purposes indistinguishable - but there are some flipped bits involved.

That's not my understanding. The same seed value to the device's random number generator should results in the exact same outputs - there's a bug being chased down in the MPS (MacOS) backend where the fixed random seed doesn't output the same image on different computers.

Re: A Web UI for Stable Diffusion

#80
post #60
post #54

I’m waiting for someone to wrap this up into a desktop app that I can install and run on my Mac.

I've been looking into this for the last 2 days. Unless you're running an M1 Mac or newer, you're SOL. Stable Diffusion is built on PyTorch. PyTorch mainly has been designed to work with Nvidia cards. However PyTorch added support for something called RocM like a year ago that adds compatibility with newer AMD cards. Unfortunately RocM doesn't support slightly older AMD cards in conjunction with intel processors. So…

Apple's MPS drivers supports AMD GPUs on MacOS
Post reply on HN