Stable Diffusion Resources

This page is very much in progress, there will be some unfinished sections and areas that are outdated.



Contact

Discord: kole#0002
Twitter: @ignkxly


Installation

Web UI (NVIDIA)

  • Download and install Git
  • Download and install Python 3.10.6
  • Create a new folder on your C: drive, call it "AI"
    • The name and file location are optional, this is just for ease of use
  • Open Git Bash
  • In Git Bash, type cd C:\AI
    • If the location and folder name is different from the one I made, change the command accordingly
      • If your file location includes spaces in the name, wrap the command in quotation marks. E.g., "cd C:\Artificial Intelligence"
  • On stable-diffusion-webui's GitHub, click the green "Code" button. Then click the button that copies the HTTPS, or copy it manually
  • In Git Bash, type git clone and then paste the URL you copied from GitHub
    • It should look similar to git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
  • Go to Hugging Face and download v1-5-pruned-emaonly.ckpt from stable-diffusion-1.5
  • Go to GFPGAN's GitHub and download V1.4 model
  • Drag GFPGANv1.4.path into C:\AI\stable-diffusion-webui
  • Drag v1.5-pruned-emaonly.ckpt into C:\AI\stable-diffusion-webui\models\Stable-diffusion
  • Run webui-user.bat from C:\AI\stable-diffusion-webui to start Stable Diffusion
    • It will begin installing dependencies which can take around an hour
    • Tip: clicking anywhere inside the Command Prompt window WILL pause the installation

If you get an error saying Python was not found; run without arguments to install from the Microsoft Store, install Python 3.10 from the Microsoft Store at https://www.microsoft.com/store/productId/9PJPW5LDXLZ5, then re-run the webui-user.bat

Image description

  • Once Stable Diffusion has started, go to your browser and enter http://127.0.0.1:7860/ in the URL

AMD

I have not tested this method personally and I cannot at the moment promise that it works.

  • Download and install Python 3.10.6
  • Create a new folder on your C: drive, call it "stable-diffusion-amd"
    • The name and file location are optional, this is just for ease of use
  • Go to harishanand95's GitHub and download diffusers_dml.zip
  • Extract diffusers_dml.zip into C:\stable-diffusion-amd
  • Download ort_nightly_directml-1.13.0.dev20220908001-cp310-cp310-win_amd64.whl
  • Drag ort_nightly_directml-1.13.0.dev20220908001-cp310-cp310-win_amd64.whl into C:\stable-diffusion-amd
  • Open Command Prompt as an administrator and run these commands in order cd C:\stable-diffusion-amd, python -m venv amd_venv, cd amd_venv/Scripts, activate, cd C:\stable-diffusion-amd\diffusers-dml, pip install -e ., cd C:\stable-diffusion-amd, pip install ort_nightly_directml-1.13.0.dev20220908001-cp310-cp310-win_amd64.whl, pip install transformers scipy ftfy
    • If the location and folder name is different from the one I made, change the command accordingly
      • If your file location includes spaces in the name, wrap the command in quotation marks. E.g., "cd C:\Stable Diffusion"
  • In the same Command Prompt window, type huggingface-cli login, then go to https://huggingface.co/settings/tokens in your browser. Then click "New token" if you don't have one already. Call it whatever you'd like, for this example I'll just pretend it's 12345. Set the role to read. Copy your newly created token and paste it into the Command Prompt window. Now if for some reason you get an error saying Invalid token passed!, there's a workaround. In File Explorer, go to C:\stable-diffusion-amd\amd_venv\Lib\site-packages\huggingface_hub\commands and open the user.py file. Look for token = getpass("Token: "). Add a " and # so it looks like token = "#getpass("Token: ") and paste the token between the " and # so that it looks like token = "12345#getpass("Token: "). Click CTRL + S to save the file then close it. Now re-run the command huggingface-cli login and it should work automatically.
    Image description
  • In the same Command Prompt window, type cd C:\stable-diffusion-amd\diffusers-dml\examples\inference. Then type python save_onnx.py. This might take around fifteen minutes to finish running.

Artroom (NVIDIA)

  • Download and run the installer, the latest version of Artroom can be found on their GitHub. A tip for installing: If your Windows user has a space in it, for example, "John Doe", I recommend changing the installation path as Artroom has some issues with spaces.

Stable Diffusion Websites


PixAI: https://pixai.art - Relatively new website, mostly for AI images of anime although it does allow posting of other categories of AI images. One great feature is the ability to generate images using Stable Diffusion on PixAI's servers. While these images do regularly take over 24 hours to generate, for anyone who has low end hardware, this site is a great alternative due to it being completely free to use.

AI Image Posting Service: https://ai-image-posting-service.com - Allows for posting AI images, again, typically it's used for anime but can be used for any kind of AI generated images. AI Image Posting Service has been around longer and has a larger community so there's a lot more art on there as well as very unique styles. A great feature they have is the ability to share your prompt, negative prompt, seed and any other details you'd like to share when posting. This is great if you want to experiment with other's prompts.


How to Use

Web UI (NVIDIA)


Basic UI


Stable Diffusion checkpoint

This drop down menu allows you to select the model you'd like Stable Diffusion to run off of. It will list all models located in stable-diffusion-webui\models\Stable-diffusion

Image description


Prompt Tools

These two buttons give you a few simple shortcuts to basic features for your prompts. The 🎨 icon adds a random famous artist to the prompt. This is used to copy an artist's style. The ↙️ icon grabs all the settings such as prompt, model, negative prompt, etc from your last generated image and inputs them into their respective fields.

Image description


Styles

Styles allow you to save a set of prompts or negative prompts for later use. To save a style, type something you wanna save into either of your prompt fields then click the 💾 icon to save it as a style. To apply one of your styles, click either of the "Style 1" or "Style 2" drop down menus and select your style. "Style 1" means prompt while "Style 2" means negative prompt. After selecting your style click the 📋 icon to apply it to the prompt you've selected.

Image description
Image description


Basic Buttons

The bright orange "Generate" button is what you use to generate your image after entering in all your desired settings.

Image description

The "Save" button lets you save your generated image(s) to folder separate from your default output area.

Image description

The "Send to img2img" button automatically sends your generated image into the img2img tab for further editing.

Image description

The "Send to inpaint" button automatically sends your generated image into the inpainting tab where you can draw over certain areas of your image using AI.

Image description

The "Send to extras" button automatically sends your generated image into the extras tab for upscaling.

Image description

The 📂 icon will open up the folder your image automatically outputs to in a new File Explorer window.

Image description

Turning on "Make Zip when Save?" makes it so the AI automatically saves the generated images as a ZIP file instead of image files.

Image description


txt2img

txt2img allows you to write text in order to generate an image based off of what you've written.

Image description


Prompt:

This is where you describe what you want the AI to create. E.g., a boy wearing a red t-shirt and gray sweatpants

Image description


Negative prompt:

This is where you specify things you DON'T want the AI to create. E.g., blue shirt

Image description


Sampling

Sampling steps is how many images the AI creates before generating the final image, too high can result in distorted images, and too low can result in low quality images.

Sampling method decides what method it will use to generate the image, some give you more detail and a more photo-realistic look, while some provide a more soft feel.

Image description


Width & Height

The width and height sliders control the resolution in pixels of what the final outcome of your image will be.

Image description


Restore faces, Tiling, and Highres, fix

Restore faces can sometimes fix details such as uneven eyes or weirdly shaped mouths depending on the image. Note that this only works on semi-realistic images of faces and not anime or cartoons.

Tiling allows you to generate repeatable textures or images.

Highres, fix usually fixes the AI adding a second character or another head when using higher resolutions such as 1024x576 for example. It is recommended to use this if the image you're generating is anything over 768x768.

Image description


Batch count & Batch size

Batch count controls how many images will be created during one generation. For example, if you were to set the slider to ten, it would generate ten seperate images using the same prompt.

Batch size determines how many images will be generated at a time. The generation time will be split equally across all images.

Image description


CFG scale

The CFG scale is what decides how closely the AI sticks to your prompt. The higher the number, the more accurate to your prompt the AI will be, which can lead to the image being slightly distorted due to it trying to be so accurate. The lower the number, the less accurate to your prompt the AI will be which can end up creating very random images that aren't even close to your prompt.

Image description


Seed

The seed is a string of numbers that decides which image will be generated. The seed is what makes it extremely rare to end up with two of the exact same image. Setting the seed to -1 results in a random image using your prompt for every generation. Clicking "Extra" near the seed box allows you to create variations of an already generated image. For example, say you've generated an image but you'd like to see some very slight adjustments without changing the prompt. Using variations you can create very small but noticeable changes in your image without adjusting the prompt or seed.

Image description


Script

Coming soon


img2img

img2img


Prompting


Aspect Ratios


Comparisons


Steps


Models

Torrenting Guide

Many of the models listed below require a torrenting client. For those who don't understand torrenting, here's a basic guide on it.

  • Torrenting requires a torrenting client. There are a couple of great open source torrenting clients but the one we're going to be using for this guide is called Deluge. Download and install Deluge at https://deluge-torrent.org/. Once Deluge is installed, open it. In Deluge click the + button.
    Image description
  • After that click URL, then import your torrent URL. It should begin with "magnet:?xt=urn:btih:"
    Image description
  • It will then ask you to select which files you want to download, select whatever suits your needs. Lastly, click Add and your files will begin downloading.
    Image description

Model Downloads

Anything

Latest version: 3.0
Download: https://huggingface.co/Linaqruf/anything-v3.0

Stable Diffusion

Latest version: 1.5
Download: https://huggingface.co/runwayml/stable-diffusion-v1-5
Description: Stable Diffusion is a latent text-to-image diffusion model capable of generating photo-realistic images given any text input.

Waifu Diffusion

Latest Version: 1.3
Download: https://huggingface.co/hakurei/waifu-diffusion-v1-3
Description: Waifu Diffusion is a latent text-to-image diffusion model that has been conditioned on high-quality anime images through fine-tuning.

Elysium

Latest Version: 2
Download: https://huggingface.co/hesw23168/SD-Elysium-Model
Description: Elysium - high quality general model with realistic style. Elysium Anime - anime tune of Elysium base model, detailed versatile anime style

NovelAI

Latest Version: N/A
Download:

Edit
Pub: 15 Nov 2022 04:52 UTC
Edit: 24 Apr 2023 04:56 UTC
Views: 8662