Stable Diffusion: Tutorials, Resources, and Tools
Tags: tutorial, machinelearning, stablediffusion, opensource
Published: 2022-09-10 06:17:40

On the 22nd of August, [Stability.ai founder Emad Mostaque announced the release of Stable Diffusion](https://stability.ai/blog/stable-diffusion-public-release) - an AI generative art model that has not only superior capabilities to the likes of DALL·E 2 but is also available as an open-source project. In those 2 weeks since its release, people have abandoned their personal endeavors and projects to give Stable Diffusion their full attention.

I was already quite excited [when OpenAI announced DALL·E 2](https://openai.com/dall-e-2/), and I was also fortunate enough to get early access. But having toyed around with Stable Diffusion for the last couple of days, I can say that DALL·E 2 doesn't come even close to what Stable Diffusion brings to the table.

And the fact that it is open-source also makes it much more accessible. In just 2 weeks, sites like [Lexica](https://lexica.art/) have archived over 10 million AI-generated images. I also fully expect that developers will make steady strides to integrate Stable Diffusion with the most popular graphic design tools, such as Figma, Sketch, and others. The ability to generate high-quality art on the go is unprecedented.

![kerala village, sharp focus, wide shot, trending on ArtStation, masterpiece, by Greg Rutkowski, by Ross Tran, by Fenghua Zhong, octane, soft render, oil on canvas, colorful, cinematic, environmental concept art](https://stackdiary.com/wp-content/uploads/2022/09/ddf10c66-5f2b-4c29-8531-eb02cf4d848a.webp)

"Kerala village, sharp focus, wide shot, trending on artstation, masterpiece, by greg rutkowski, by ross tran, by fenghua zhong, octane, soft render, oil on canvas, colorful, cinematic, environmental concept art"

The purpose of this article is to list all the interesting and relevant tutorials, resources, and tools to help you get up to speed with Stable Diffusion quickly. I do believe over the coming months we're going to see a massive influx of projects that specialize in extracting the most potential out of Stable Diffusion, and I will do my best to keep this article updated accordingly.

*   👉 **Tutorials** - this section is focused heavily on topics such as _"How to use Stable Diffusion?"_.
*   💻 **Resources** - this section is focused on queries such as _"What is Stable Diffusion?"_.
*   🚀 **Tools** - this section is based on tools that let you use Stable Diffusion yourself.

So without further ado - let's start with the basics.

* * *

Resources & Information
-----------------------

One of the first questions a lot of people have about Stable Diffusion is the license that this model is published under, and whether the generated art is _free_ to use for personal and commercial projects.

The license Stable Diffusion is using is **CreativeML Open RAIL-M**, and can be [read in full over at Hugging Face](https://huggingface.co/spaces/CompVis/stable-diffusion-license). In short, _"Open Responsible AI Licenses (Open RAIL) are licenses designed to permit free and open access, re-use, and downstream distribution of derivatives of AI artifacts as long as the behavioral-use restrictions always apply (including to derivative works)."_.

A more detailed explanation for this license is available on [this BigScience page](https://bigscience.huggingface.co/blog/bigscience-openrail-m).

### What images were used to train the Stable Diffusion model?

AI modeling is the means of creating and training Machine Learning algorithms for a specific purpose. In this case, the purpose of generating images from user prompts.

If you're curious as to which images Stable Diffusion used - [Andy Baio together with Simon Willison did a thorough analysis](https://waxy.org/2022/08/exploring-12-million-of-the-images-used-to-train-stable-diffusions-image-generator/) of over 12 million images (from a total of 2.3 billion) that were used to train the Stable Diffusion model.

Here are some of the key takeaways:

*   The datasets which were used to train Stable Diffusion were the ones put together by [LAION](https://laion.ai/).
*   Out of the 12 million images they sampled, 47% of the entire sample size came from 100 domains, with Pinterest yielding as much as 8.5% of the entire dataset. Other top sources included WordPress.com, Blogspot, Flickr, DeviantArt, and Wikimedia.
*   Stable Diffusion doesn't restrict the use of generating art from people's names (be it celebrities or otherwise).

It will be interesting to see how the model evolves, and whether companies will be willing to contribute their own media to help Stable Diffusion grow.

### Where to find Stable Diffusion examples & prompts?

One of the ways in which Stable Diffusion differs from the likes of DALL·E is that to get the most out of Stable Diffusion you have to learn about its **modifiers**. One modifier, in particular, is called the **seed** - whenever you generate an image with Stable Diffusion, that image will be assigned a seed, which can also be understood as the general composition of that image. So, if you enjoyed a particular image and wish to replicate its style (or at least as close as possible to it) - you can use seeds.

![Lexica](https://stackdiary.com/wp-content/uploads/2022/09/Lexica-1024x500.png)

The best platform for finding example images and the prompts that were used to generate those images is [Lexica](https://lexica.art/), which archives over 10 million sample artworks. Each artwork includes its full prompt, but also the seed number which you can then reuse yourself.

* * *

Tools & Software
----------------

If you've seen or been captivated by the art created with Stable Diffusion, you might be wondering whether you can try it out for yourself. And the answer is yes, there are multiple ways to try Stable Diffusion for free, including doing so from the browser or your own machine.

The official way to do so is to use [the DreamStudio platform](https://beta.dreamstudio.ai/).

![DreamStudio example](https://stackdiary.com/wp-content/uploads/2022/09/DreamStudio-example.png)

Anyone can register for free, and new accounts get a complimentary 200 free tokens. These tokens are sufficient for 200 generations as long as you don't increase complexity and don't change the height and width past the 512x512 default setting. But if you do increase the complexity, you're probably going to run out of your tokens rather quickly.

### How to run Stable Diffusion on your own machine?

At this time, the most popular solution for running Stable Diffusion locally is [the Stable Diffusion Web UI repo available on GitHub](https://github.com/sd-webui/stable-diffusion-webui). Based on the Gradio GUI - this is as close as it gets to the actual DreamStudio interface, and you can wave goodbye to any kind of limitations.

**What are the PC requirements for Stable Diffusion?**  
  
**\-** 4GB (more is preferred) VRAM GPU (Official support for Nvidia only!)  
**\-** AMD users [check here](https://www.reddit.com/r/StableDiffusion/comments/ww436j/howto_stable_diffusion_on_an_amd_gpu/)  
**\-** M1/M2 users [check here](https://www.reddit.com/r/StableDiffusion/comments/wx0tkn/stablediffusion_runs_on_m1_chips/) and [here also](https://twitter.com/levelsio/status/1565731907664478209)

Keep in mind that to use the Web UI repo, you will need to download the model yourself from Hugging Face. Make sure you fully read [the Installation guide](https://github.com/sd-webui/stable-diffusion-webui/wiki/Installation) (Windows) to set it up properly. For Linux, [check this guide](https://github.com/sd-webui/stable-diffusion-webui/wiki/Linux-Automated-Setup-Guide). And you can also get it up and running on Google Colab - [guide here](https://github.com/altryne/sd-webui-colab).

### How big is the Stable Diffusion model?

As I mention above, you have to download the Stable Diffusion model yourself, and the link to do so can be found [here](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/tree/main). You will need to create an account on Hugging Face, and afterward, accept the license terms for the model before you're able to view and download its files.

![stable diffusion model files on hugging face](https://stackdiary.com/wp-content/uploads/2022/09/stable-diffusion-model-files-on-hugging-face.png)

One of the questions people have is, _"How come the model is only 4GB in size even though it has been made from over 2 billion images?"_.

And the best answer to this question comes from [a Hacker News user juliendorra](https://news.ycombinator.com/item?id=32785768) ⟶

> 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 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.

* * *

Tutorials & Guides
------------------

The following section is dedicated entirely to tutorials and guides to help you extract the most juice out of your Stable Diffusion prompts. As I said, I will do my best to keep this updated as more guides become available and a better understanding of the model is gained.

### Ultimate Beginner's Guide

Arman Chaudhry published [a compact Google Docs presentation](https://docs.google.com/document/d/1sgXAnFMEfx-I_Harts7cEGEPAtmWGvl62yJHByPE0ZI/edit) on the essentials of SD.

This guide covers all of the modifiers that SD supports but also recommends the best practices for width/height settings, as well as common mistakes to avoid.

### Stable Diffusion Akashic Records

If you're looking to do a deep dive (or need references for research) - the [SD Akashic Records](https://github.com/Maks-s/sd-akashic) repository has an astounding amount of resources for you to study.

You'll find everything from keyword usage, to prompt optimization, to style guides. There are also mentions of several tools, outside of those already mentioned in this article.

### Stable Diffusion Prompt Cheatsheet

If you're looking for inspiration to apply custom styles and effects to your prompts, [check out this blog post from Moritz](https://moritz.pm/posts/parameters). It covers prompt additions for concepts like 2D & 3D art, details, lighting, colors, and environments.