Stable diffusion tutorial. ULTIMATE guide - everything you need to know!

Stable diffusion tutorial. ULTIMATE guide - everything you need to know!

Creating AI Images in 5 Minutes

In this tutorial, Seb guides viewers through the process of creating AI images in just five minutes. He provides step-by-step instructions on how to download and install the necessary software, as well as how to use it to create stunning AI-generated images.

Downloading and Installing Required Software

  • Google "Automatic One One One" and enter the GitHub page.
  • Scroll down to find installation instructions for Windows.
  • Download the Windows installer 64-bit and run it, making sure to check the box that says "Add Python to PATH."
  • Download Git for Windows 64-bit and leave everything at default settings.
  • Open Command Prompt by typing CMD in the search bar. Copy and paste "git clone" followed by a link from Hugging Face into Command Prompt.

Downloading Models

  • Create an account on Hugging Face's website and download the standard weights file.
  • Enter your user folder, then navigate to Stable Fusion Web UI > models > stable diffusion. Drag the downloaded model file into this folder and rename it "model."

Running Stable Diffusion

  • Open Notepad and add "git pull" before running web UI Dash User. This will ensure that you have the latest files from GitHub.
  • Wait for Stable Diffusion to finish installing (this may take some time), then access it through a web browser using a specific URL provided by Seb.

Using Stable Diffusion

  • Stable Diffusion's user interface includes several tabs, including "Text to Image," which allows users to create images out of pure text.
  • Use the web user interface to create AI-generated images quickly and easily.

Generating Images with Stable Diffusion

In this section, the speaker explains how to generate images using stable diffusion. They discuss the importance of prompts and provide examples of how to use them effectively.

Using Prompts

  • The first step in generating an image is to work with prompts.
  • Prompts allow you to specify what you want in your image, such as the object or additional details like hyper-realism or 8K resolution.
  • To find prompts, visit lexica.art, a stable diffusion search engine that provides a library of images and their corresponding prompts.
  • If you're feeling lost with prompts, look at some great stable diffusion images and copy those prompts before changing them to suit your needs.

Changing Settings

  • Sampling steps are one of the many options available when generating an image with stable diffusion.
  • The speaker recommends starting with klms for consistent results and using at least 50 sampling steps.
  • Other samplers like Euler ancestral can handle lower sampling steps but may be inconsistent in their results.

Overall, generating images with stable diffusion requires working with effective prompts and adjusting settings like sampling steps to achieve desired results.

Understanding Stable Diffusion Web UI

In this section, the speaker explains how to use the Stable Diffusion Web UI and its various features.

Restoring Faces

  • The "Restore Faces" option can fix certain issues with images.
  • However, if you want to restore an image using this function, you cannot simply press "generate" again because the seed is randomized each time.
  • If you want to restore an image with the same settings, you need to copy and paste the settings from the previous file.

Batch Count and Batch Size

  • The batch count and batch size determine how many images are generated.
  • Increasing or decreasing these values will result in a grid of images being generated.
  • All generated images are saved in the output folder.

Scale

  • The scale determines how closely the AI listens to your prompts.
  • A lower scale means that the AI will not listen as closely to your prompt and may create something it likes instead.
  • A higher scale means that the AI will pay closer attention to your prompt.

Image Size

  • Stable diffusion has been trained on 512x512 pixel images, so using this size will result in more consistent results.
  • Using larger sizes may cause crashes.

Seed

  • The seed determines what noise is used for generating an image.
  • Each new image in a batch gets a new seed, but you can reuse an old seed by pressing "-1".

Restore Faces Example

The speaker demonstrates how restoring faces can improve an image's quality.

Scale Example

The speaker demonstrates how changing the scale affects image generation.

Adapting the Prompt

In this section, the speaker explains how to adapt the prompt by changing its importance and adding emphasis to certain words. They also discuss how to adjust the scale value for better results.

Adapting the Prompt

  • To adapt a prompt, change its importance and add emphasis to certain words using parentheses.
  • The more emphasis added, the more focus it will give to those words.
  • Adjusting the scale value is important for better results. A value between 7 and 14 is usually good.

Image-to-Image Generation

In this section, the speaker discusses image-to-image generation and how it can be used with input images to create new images.

Using Input Images for Image-to-Image Generation

  • Image-to-image generation can be used with input images to create new images.
  • Denoising strength is an important setting that determines how much noise is added or removed from an image during generation.
  • Higher denoising strength values move away from the original image while lower values keep closer to it.
  • Adjusting denoising strength is crucial in creating an image that resembles the input image.

Image Manipulation with DALL-E

In this section, the speaker demonstrates how to manipulate images using DALL-E.

Adjusting Strength

  • If the generated image does not resemble the input image, adjust the strength parameter.
  • Start with a high strength and lower it as you approach your desired output.

Using Inpaint

  • Use inpaint to change only part of an image.
  • Use a brush to paint over parts of the image that you want to save or remove.
  • The masked content setting determines what should be filled before stable diffusion starts creating your new prompt. Choose original or latent noise depending on what was in the original image.

Painting Over Unwanted Parts

  • Increase denoising strength to change more of an image.
  • Use Photoper (an online Photoshop tool) to paint over unwanted parts of an image so that stable diffusion thinks they are something else.

Working with Stable Diffusion

In this section, the speaker explains how to work with Stable Diffusion from start to finish. They cover topics such as text-to-image, image-to-image, in-painting, and upscaling.

Using Masks for In-Painting

  • To use a mask for in-painting, upload the mask image or draw one.
  • Adjust the mask blur setting to control how much blur is applied to the edge of the mask.
  • Generate multiple images until you find one that you like.

Generating New Images

  • To generate a new image from an existing one, send it to "image-to-image."
  • Lower the denoising strength if you don't want significant changes made to your image.
  • Save the seed if you want to recreate a specific face later on.

Refining Generated Images

  • Drag an image back into Stable Diffusion and adjust settings as needed.
  • Run multiple batches of images since not every batch will produce good results.
  • Use "restore faces" when necessary.

Upscaling Images

  • Use an upscaler like SwinIR or LDSR to enlarge your image.
  • SwinIR produces high-quality results quickly.

Conclusion

Stable Diffusion offers advanced features like textual immersion, dream booth, and animation. For more information on these features, check out other tutorials on the speaker's channel. The speaker also reveals that only one of six images shown at the beginning was real.

Video description

In this tutorial I'll go through everything to get you started with #stablediffusion from installation to finished image. We'll talk about txt2img, img2img, prompting, sampling methods, inpainting, upscalers and more! Start using stable diffusion today and forget about midjourney and dalle2. Make sure you install Python 3.10.x like 3.10.7. This will NOT work with Python 3.11 Please support my work on Patreon for early access videos. It will also help me keep creating these videos: https://www.patreon.com/sebastiankamph Links: https://github.com/AUTOMATIC1111/stable-diffusion-webui You don't need the model from Huggingface anymore. Just get a random model from https://civitai.com/ that you think looks cool. I recommend Deliberate. Model 1.4 is replaced by 1.5. Model 1.5: https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.safetensors Model 2.1: https://huggingface.co/stabilityai/stable-diffusion-2-1/blob/main/v2-1_768-ema-pruned.safetensors Prompt styles here: https://www.patreon.com/posts/sebs-hilis-79649068 Chat with me in our community discord: https://discord.gg/sebastiankamph My Weekly AI Art Challenges https://www.youtube.com/playlist?list=PLXS4AwfYDUi7RvFm4K6lKBH_acaZQMKY4 My Stable diffusion workflow to Perfect Images https://youtu.be/4u-Ytioi3DM ControlNet tutorial and install guide https://youtu.be/vFZgPyCJflE Famous Scenes Remade by ControlNet AI https://youtu.be/wVbWZ-Ph9lE LIVE Pose in Stable Diffusion https://youtu.be/uAI_FBK6UPc Control Lights in Stable Diffusion https://youtu.be/_xHC3bT5GBU Ultimate Stable diffusion guide https://youtu.be/DHaL56P6f5M Inpainting Tutorial - Stable Diffusion https://youtu.be/No1_sq-i_5U The Rise of AI Art: A Creative Revolution https://youtu.be/Ujpr62w7qcU 7 Secrets to writing with ChatGPT (Don't tell your boss!) https://youtu.be/G5pld_ELBI0 Ultimate Animation guide in Stable diffusion https://youtu.be/lztn6qLc9UE Dreambooth tutorial for Stable diffusion https://youtu.be/Z-hyKADmHmE 5 tricks you're not using in Stable diffusion https://youtu.be/-5TaeHvnVxE Avoid these 7 mistakes in Stable diffusion https://youtu.be/b8xWjrzTAPY How to ChatGPT. ChatGPT explained https://youtu.be/APvEaj19Io4 This is Adobe Firefly. AI For Professionals https://youtu.be/TInvekF6NRw Adobe Firefly Tutorial https://youtu.be/ifnAjKiMVaU ChatGPT Playlist https://www.youtube.com/playlist?list=PLXS4AwfYDUi7USniHdj0RmGhOgWHitmCN CHAPTERS 0:00 Introduction 0:35 Installation 5:05 Running Stable diffusion 6:31 Prompting 9:01 Sampling methods 11:20 Running Stable diffusion 20:23 Img2img 24:33 Inpainting 31:41 Upscalers 32:48 Closing words