How does Stable Diffusion work? (Two Minute Papers Video)

in STEMGeekslast year (edited)

Wie funktioniert Stable Diffusion, die AI, die aus beliebigem Text künstlerische bis foto-realistische Bilder generieren kann?

Stable Diffusion ist ein Meilenstein in der AI-Entwicklung und, wenn man so will, eine Weiterentwicklung von Dall-E 2, einer Text-zu-Bild AI, die von OpenAI entwickelt wurde.

Anders als OpenAI ist Stable Diffusion tatsächlich open, da sowohl der Source Code als auch das trainierte Modell unter einer relativ freien Open-Source-Lizenz (Creative ML OpenRAIL-M) veröffentlicht wurde.

Stable Diffusion wurde ursprünglich von der Ludwig-Maximilians-Universität München mitentwickelt und vor Kurzem von Stability AI als Open-Source veröffentlicht.

Die Idee hinter Diffusion ist vereinfacht gesagt, ein neuronales Netzwerk zu trainieren, dass schrittweise Bildrauschen aus einem Bild entfernen kann (Backwards Diffusion Process) und aus einem komplett verrauschten Bild wieder das Ursprungsbild unter zu Hilfenahme der Text-Beschreibung (Input und Attention Layer) rekonstruieren kann.

Die AI startet also mit zufälligen Pixel-Rauschen und siebt aus diesem dann schrittweise ein sinnvolles Bild heraus unter Einbeziehung der Text-Beschreibung, die man angegeben hat.

Das Ganze klingt wie Magie, beruht aber letztendlich auf einem extrem großen neuronalen Netzwerk, das mit Milliarden Bildern und Bildbeschreibungen trainiert wurde.

Das Ursprungsmodell benötigte 256 Nvida A100 GPUs und 150,000 GPU-Stunden, um das neuronale Netz zu trainieren und kostete laut Wikipedia mehr als eine halbe Million Dollar an Rechenleistung.

Stable Diffusion wendet noch einen Trick an (Latent Diffusion), der es ermöglicht, Bilder in Folge auf normalen, leistungsstarken Gaming-Rechnern, PCs oder sogar Laptops zu generieren.

Für das Generieren der Bilder ist kein Supercomputer mehr notwendig, sondern jeder kann das Modell praktisch zu Hause mit einer leistungsstarken GPU selbst verwenden.

Das ist ein weiterer bahnbrechender Meilenstein von Diffusion-Modellen.

Um das zu erreichen verwendet Stable Diffusion Variational Autoencoders (VAE) und komprimiert das Bild sozusagen in einen niedrigdimensionalen latenten Raum und der Backward-Diffusion-Prozess wird dann in diesem latenten Raum anstatt im Pixel-Raum ausgeführt.

Das spart Zeit und Ressourcen.

Am besten ihr schaut euch die beiden Videos an, die den Stable Diffusion high-level beschreiben.

Jedenfalls ist es ziemlich unglaublich und faszinierend, was man damit alles machen kann und dass dieses Modell auf einem normalen PC ausgeführt werden kann und dass es so gut funktioniert ist teilweise schon unheimlich und erinnert mich an das Star Trek Holodeck, wo man auch deklarativ mit einer kurzen Beschreibung ganze Welten erschaffen kann.

Das wird jetzt teilweise Realität.

Mittels AI-Forschung wird es uns vielleicht gelingen, einen tieferen Einblick zu bekommen, was Intelligenz und Kreativität überhaupt ist, und letztendlich auch unsere eigenen kognitiven Prozesse in unserem Gehirn besser zu verstehen.

Was sagt ihr dazu? Ist ziemlich faszinierend, was mit AI mittlerweile möglich ist.

Stable Diffusion Two Minute Papers Video

Video Credit: Two Minute Papers

How does Stable Diffusion work? – Latent Diffusion Models EXPLAINED

Video Credit: AI Coffee Break with Letitia

Paper: High-Resolution Image Synthesis with Latent Diffusion Models

https://ommer-lab.com/research/latent-diffusion-models/

Stable Diffusion Public Release

https://stability.ai/blog/stable-diffusion-public-release

Try it out yourself, create Stable Diffusion art with this bot on Discord

https://peakd.com/hive-163521/@vikisecrets/create-stable-diffusion-art-with-the-ausbitbank-art-bot-on-discord-two-bees-playing-ping-pong-in-space

English

How does Stable Diffusion, the AI that can generate artistic to photo-realistic images from arbitrary text, work?

Stable Diffusion is a milestone in AI development and, if you will, an evolution of Dall-E 2, a text-to-image AI developed by OpenAI.

Unlike OpenAI, Stable Diffusion is indeed open, as both the source code and the trained model have been released under a relatively free open source license (Creative ML OpenRAIL-M).

Stable Diffusion was originally co-developed by Ludwig Maximilian University Munich and recently released as open-source by Stability AI.

The idea behind Diffusion is to train a neural network that can gradually remove noise from an image (Backwards Diffusion Process) and thus reconstruct the original image from a completely noisy image using the text description (input and attention layer).

So the AI starts with random pixel noise and then sifts out a meaningful image step by step, taking into account the text description that was given.

This sounds like magic, but is ultimately based on an extremely large neural network that has been trained with billions of images and image descriptions.

The original model required 256 Nvida A100 GPUs and 150,000 GPU hours to train the neural network and cost more than half a million dollars in computing power, according to Wikipedia.

Stable Diffusion applies one more trick (Latent Diffusion) that allows it to generate images on normal, powerful gaming computers, PCs and even notebooks.

There is no longer a need for a supercomputer to generate the images, anyone can practically use the model themselves at home with a powerful GPU.

This is another groundbreaking milestone of diffusion models.

To achieve this, Stable Diffusion uses Variational Autoencoders (VAE) and compresses the image into a low-dimensional latent space, so to speak, and the backward diffusion process is then performed in this latent space instead of pixel space.

This saves time and resources.

Best you watch the following two videos describing Stable Diffusion high-level.

Anyway, it's pretty incredible and fascinating what you can do with it and that this model can be run on a normal PC and that it works so well is partly scary and reminds me of the Star Trek holodeck where you can also create whole worlds declaratively with a short description.

This is now partly becoming reality.

By means of AI research, we may be able to gain a deeper understanding into what intelligence and creativity actually are, and ultimately better understand our own cognitive processes that are happening in our brains.

What do you guys think? It's pretty fascinating what's already possible with AI today.

Live your Secrets and Hive Prosper 🍯

xx Viki @vikisecrets

Posted with STEMGeeks

Sort:  

Servus!
Ich habe es endlich geschafft, hir auf Hive zu sein!
Ich freue mich, dass ich gleich einmal Deinen tollen post gefunden habe.

Super, willkommen auf Hive :)

Schöne Zusammenfassung. AI bezüglich fand ich das ganz interessant https://t3n.de/news/ki-ende-der-menschheit-oxford-studie-finstere-antwort-1500285/

oh wow! those images are truly amazing! and anyone can do that.. 😊😎

Dalle2 is not only not open and overhyped but after I got my invite/access I used all my points already for this month. 15$ to fill my account does not make sense as one cannot choose between a pallet of different styles which is groundbreaking

Not to mention materials etc.
The app is called starryai haha seems this is a different one 🤣