Live data from Hacker News

A Web UI for Stable Diffusion

github.com

51–60 of 148 posts

Re: A Web UI for Stable Diffusion

#51
post #36

Earlier quoted context omitted.

Presumably the number of faces in the training set far exceeds the number of dice by more than a few orders of magnitude.

In one of the other posts I noticed this option: > GFPGAN Face Correction: Automatically correct distorted faces with a built-in GFPGAN option, fixes them in less than half a second So apparently there is still an issue with faces.

Yep, it gets faces mostly right, but as they say, the devil's in the details. Eyes in particular don't seem to have clearly delineated concentric circles for irises and pupils, instead they are often rendered as a "swirl".

Example image directly from Stable Diffusion:

https://i.imgur.com/XSk8fIv.png

And here is that image run through GFPGAN:

https://i.imgur.com/I53AGmh.png

Interesting to note how specialised GFPGAN is, as some of the other details (flowers, hair) seem to be worse in the processed image. I plan to finish this image by manually blending the best of both pictures.

Re: A Web UI for Stable Diffusion

#52
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…

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?

Re: A Web UI for Stable Diffusion

#53

I have a 6gb 1660ti, barely holding on. Is a new 12gb card good enough for now, or should I go even higher to be safe for a few years of sd innovation?

How is M1/M2 support for SD? Is there a significant performance drop? Presumably you would be able to buy a 32GB M2 and be future proof because of the shared memory between CPU/GPU.

I recently switched from a CPU-only version to this repo release 1.13: https://github.com/lstein/stable-diffusion

The original txt2img and img2img scripts are a bit wonky and not all of the samplers work, but as long as you stick to dream.py and use a working sampler, I have had good luck with k_lms, then it works great and runs way faster than the cpu version.

Works great on 32gb ram but I'm honestly tempted to sell this one and get a 64gb model once the m2 pros come around. This is capable of eating up all the ram you can throw at it to do multiple pictures simultaneously.

Re: A Web UI for Stable Diffusion

#55
post #41
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…

SD has 860M weights for the main workhorse part. At 16-bit precision that is only 1.6 GB of data, which in some very real sense has condensed the world's total knowledge of art and photography and styles and objects. It's not a search engine, it's self-contained and the closest analogy is that it's a very very knowledgable and skilled artist.

Is there a smaller version of the model available (<4gb) intended for use with 16 bit precision?

Re: A Web UI for Stable Diffusion

#56
post #13

People recently figured out how to export stable diffusion to onnx so it’ll be exciting to see some actual web UIs for it soon (via quantized models and tfjs/onnxruntime for web)

Very cool! Can you link to where this is taking place?

A commenter mentioned today it might be possible to pre-download the model and load it into the browser from the local filesystem rather than include such a gigantic blob as an accompanying dependency, fighting different caching RFC's, security/usage restrictions, and anything else that might inadvertently trigger a re-download.

https://news.ycombinator.com/item?id=32777909#32779093

Re: A Web UI for Stable Diffusion

#57
post #35

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…

> As it’s deterministic (given the exact same request parameters, random seed included, you get the exact same image) it’s a form of compression (or at least encoding decoding) too: I could send you the parameters for 1 million images that you would be able to recreate on your side, just as a relatively small text file. For any input image? Or do you mean an image generated by the model?

You could input an image and get it to recreate it as best as possible and then output a seed. That would be interesting!

Re: A Web UI for Stable Diffusion

#58
post #35

Earlier quoted context omitted.

> As it’s deterministic (given the exact same request parameters, random seed included, you get the exact same image) it’s a form of compression (or at least encoding decoding) too: I could send you the parameters for 1 million images that you would be able to recreate on your side, just as a relatively small text file. For any input image? Or do you mean an image generated by the model?

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.

Re: A Web UI for Stable Diffusion

#59
post #36

Earlier quoted context omitted.

In one of the other posts I noticed this option: > GFPGAN Face Correction: Automatically correct distorted faces with a built-in GFPGAN option, fixes them in less than half a second So apparently there is still an issue with faces.

Yep, it gets faces mostly right, but as they say, the devil's in the details. Eyes in particular don't seem to have clearly delineated concentric circles for irises and pupils, instead they are often rendered as a "swirl". Example image directly from Stable Diffusion: https://i.imgur.com/XSk8fIv.png And here is that image run through GFPGAN: https://i.imgur.com/I53AGmh.png Interesting to note how specialised GFPGAN i…

Ironically, that almost looks like the sort of fantasy image you'd find as GPU box art many years ago.

Re: A Web UI for Stable Diffusion

#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 my 32gb pretty powerful 2020 16in MacBook Pro isn't capable of running Stable Diffusion.

Any native app will likely have to rely on a remote cloud gpu. And boy, those are fucking expensive. Been researching what I need to stand up a service the last few days and it isn't cost friendly.

Post reply on HN