Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Installation

Hal Rottenberg edited this page Sep 1, 2022 · 8 revisions

This page describes Windows installation. To install on Linux, see this page. To install on Colab, see Altryne's notebook.

Windows - step by step Installation guide

Big thanks to Arkitecc#0339 from the Stable Diffusion discord for the original guide (support them here)

Initial Setup

Pre requisites

Install Git & Miniconda :

  • https://gitforwindows.org/ Download this, and accept all of the default settings it offers except for the default editor selection. Once it asks for what the default editor is, most people who are unfamiliar with this should just choose Notepad because everyone has Notepad on Windows.

CleanShot 2022-08-31 at 16 29 48@2x

Cloning the repo

Type git clone https://github.com/hlky/stable-diffusion.git into the prompt.

This will create the stable-diffusion directory in your Windows user folder. CleanShot 2022-08-31 at 16 31 20@2x


Once a repo has been cloned, updating it is as easy as typing git pull inside of Miniconda when in the repo’s topmost directory downloaded by the clone command. Below you can see I used the cd command to navigate into that folder.

CleanShot 2022-08-31 at 16 36 34@2x

  • Next you are going to want to create a Hugging Face account: https://huggingface.co/

  • After you have signed up, and are signed in go to this link and click on Authorize: https://huggingface.co/CompVis/stable-diffusion-v-1-4-original

  • After you have authorized your account, go to this link to download the model weights for version 1.4 of the model, future versions will be released in the same way, and updating them will be a similar process : https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt

  • Download the model into this directory: C:\Users\<username>\stable-diffusion\models\ldm\stable-diffusion-v1

  • Rename sd-v1-4.ckpt to model.ckpt once it is inside the stable-diffusion-v1 folder.

  • Since we are already in our stable-diffusion folder in Miniconda, our next step is to create the environment Stable Diffusion needs to work.

  • (Optional) If you already have an environment set up for an installation of Stable Diffusion named ldm open up the environment.yaml file in /stable-diffusion/ change the environment name inside of it from ldm to ldo

Setting up the environment

  • create the Conda environment with conda env create -f environment.yaml

  • Wait for it to process, this could take some time. Eventually it’ll look like this:

CleanShot 2022-08-31 at 16 39 59@2x

Optional additional models

There are three more models that we need to download in order to get the most out of the functionality offered by HLKY. (next versions will do this automatically)

  • The first of which is GFPGAN, a model that HLKY takes advantage of in order to (optionally) help improve the look of generated faces.

  • Download the model from here and save it into this folder: /stable-diffusion/src/gfpgan/experiments/pretrained_models

  • The next two models are for RealESRGAN an upscaling model that you can (optionally) use to upscale your generations by 4x their original resolution.

  • Download the models from here and here and save them both into this folder: /stable-diffusion/src/realesrgan/experiments/pretrained_models

  • Next, in the /stable-diffusion/ folder, you’ll see two files named webui.cmd and webuildm.cmd.

Use webui.cmd if this is your first install , webuildm.cmd is for folks who had earlier versions or different versions and are moving to this one and have the ldm named conda environment

  • webui.cmd is the main script you'll always run. After it finishes initializing it’ll spit out a localhost link: http://localhost:7860 that you can copy and paste into your web browser to start dreaming with!

CleanShot 2022-08-31 at 16 44 05@2x

  • Images created with the web interface will be saved to \stable-diffusion\outputs\ in their respective folders alongside .yaml text files with all of the details of your prompts for easy referencing later. Images will also be saved with their seed and numbered so that they can be cross referenced with their .yaml files easily.