How to Install & Use Stable Diffusion on Windows in 2024 (Easy Way)

AI Andy
7 Feb 202413:07

Summary

TLDRThe video script provides a step-by-step guide on installing and using stable diffusion models through Comfy UI, an easier alternative to the traditional Python method. It covers the installation of Comfy UI, downloading and placement of necessary files, and generating images using the stable diffusion model. The script also introduces additional features like custom nodes and higher quality models available on Civit AI, emphasizing the ease of use and powerful capabilities of the system.

Takeaways

  • 🔧 Installation of Comfy UI is recommended for easier setup compared to Python, making Stable Diffusion accessible to users with lower technical knowledge.
  • 💻 Comfy UI can be found by searching its name on Google, and the first link provides a direct download link.
  • 📂 After downloading, extract the ZIP file and move the folder to a suitable location, such as 'AI' in the Documents folder for better organization.
  • 🖥️ Users should choose the appropriate 'run' file based on their hardware, either 'run CPU' or 'run Nvidia GPU', with the latter requiring at least 8 GB of VRAM.
  • 🔄 To check VRAM, users can use the 'DXDiag' tool on Windows by typing 'dxdiag' in the Run dialog box and looking at the display information.
  • 🔗 The video provides a link to download Comfy UI on Mac, which is slightly different but still functional.
  • 📦 Downloading the necessary Stable Diffusion models, including the base and refiner models, is crucial for image generation, with file sizes ranging from 6 GB to 30 minutes depending on internet speed.
  • 🗂️ The downloaded models need to be placed in the 'checkpoints' folder within the Comfy UI directory for proper functionality.
  • 🎨 Image generation involves using the 'run Nvidia GPU' application, loading a checkpoint, and entering prompts into the Comfy UI interface.
  • 🔄 Custom nodes can be installed via the Comfy UI manager to enhance Stable Diffusion's capabilities, with a variety of nodes available for different tasks.
  • 🌐 Users can test custom models on Civit AI before downloading them to ensure they meet their quality expectations and to avoid lengthy download times.

Q & A

  • What are the two methods mentioned in the script for installing Stable Diffusion?

    -The two methods mentioned are installing through Python, which is considered the hard way, and using Comfy UI, which is described as the easy way.

  • Why is Comfy UI recommended for users with low technical knowledge?

    -Comfy UI is recommended for users with low technical knowledge because it simplifies the installation process and makes it more accessible, requiring just a few downloads and setup steps rather than dealing with complex Python installations.

  • What is the approximate size of the Comfy UI download file?

    -The Comfy UI download file is around 1.4 GB.

  • What are the two run files that users should look out for in the extracted Comfy UI folder?

    -The two run files are 'run CPU' and 'run Nvidia GPU'.

  • What is the minimum VRAM requirement for the model used in the script?

    -The model used in the script requires around 8 GB of VRAM.

  • How can users check their GPU's VRAM?

    -Users can check their VRAM by pressing Windows + R, typing 'dxdiag', clicking OK, clicking on 'Yes', and then checking the 'Display' tab to see the VRAM information.

  • What is the first model that needs to be downloaded for Stable Diffusion?

    -The first model to download is the 'stable diffusion XL base 1.0'.

  • Where should the downloaded models be placed in the Comfy UI folder structure?

    -The downloaded models should be placed in the 'models' folder within the Comfy UI directory, specifically in the 'checkpoints' subfolder.

  • How does the script suggest generating an image with Stable Diffusion?

    -To generate an image, users should click on 'run Nvidia GPU', open the interface in a web browser, load a checkpoint, enter a prompt into the 'CLIP text' field, set the desired image parameters, and then click on 'Q prompt' to start the image generation process.

  • What is the purpose of the 'Comfy UI manager'?

    -The 'Comfy UI manager' is used to install additional custom nodes and extensions that can enhance the functionality of the Stable Diffusion interface and allow users to perform more complex tasks.

  • How can users test a model before downloading it on Civit AI?

    -Users can test a model on Civit AI by using the 'run model' feature, which allows them to generate an image with the model without having to download it first.

Outlines

00:00

💻 Installing Comfy UI for Stable Diffusion

The paragraph explains the process of installing Comfy UI, an easier alternative to the traditional Python installation for Stable Diffusion. It highlights the simplicity of using Comfy UI and guides the user through the installation steps, including downloading the software, extracting the ZIP file, and placing it in the appropriate directory. The importance of checking VRAM requirements for running the Nvidia GPU version is also discussed, as well as the necessity of downloading additional packages upon the first run of the Nvidia GPU executable.

05:01

📦 Downloading and Configuring Stable Diffusion Models

This paragraph details the steps to download and configure Stable Diffusion models, including the Stable Diffusion XL base and refiner models. It provides instructions on where to place the downloaded files within the AI documents folder and emphasizes the importance of having a high-speed internet connection due to the large file sizes. The paragraph also mentions the option to download an additional model, the Think Diffusion XL, and encourages users to follow the provided links in the description for a smoother installation process.

10:02

🖼️ Generating Images with Stable Diffusion

The focus of this paragraph is on generating images using the installed Stable Diffusion models. It walks the user through the process of loading checkpoints, setting up prompts, and adjusting parameters such as image resolution and batch size. The paragraph explains the role of the K sampler in creating the image and the potential need for additional installations during the process. It also touches on the differences in prompting style compared to chat GBT and showcases the quality of images that can be produced using the base model.

🔧 Customizing Comfy UI with Add-ons

This paragraph discusses the customization of Comfy UI through the installation of add-ons, specifically custom nodes. It guides the user on how to access the Comfy UI manager on GitHub, install custom nodes via the terminal, and restart the UI for the changes to take effect. The paragraph provides examples of different nodes, such as the reactor and open pose, and explains how they can be utilized within the UI. It also introduces Civit AI as a platform for downloading custom models, testing them before installation, and achieving higher quality outputs.

Mindmap

Keywords

💡Stable Diffusion

Stable Diffusion is a type of artificial intelligence model used for generating images from text prompts. It is the central technology discussed in the video, with the aim of teaching viewers how to install and use it for image generation. The script details the process of installing various components and models to utilize Stable Diffusion effectively.

💡Comfy UI

Comfy UI is a user-friendly interface designed to simplify the process of using Stable Diffusion for those without extensive technical knowledge. It is highlighted in the script as the recommended method for installing and running Stable Diffusion, as opposed to the more complex Python installation process.

💡Installation

Installation refers to the process of downloading and setting up software or applications on a computer. In the context of the video, it involves the detailed steps required to install Comfy UI and Stable Diffusion models to enable image generation.

💡Nvidia GPU

Nvidia GPU refers to a graphics processing unit manufactured by Nvidia, which is used for rendering images, videos, and animations. The script emphasizes the importance of having an Nvidia GPU with sufficient VRAM (video random-access memory) to run the Stable Diffusion model effectively.

💡VRAM

VRAM, or video random-access memory, is the memory used to store image data for the GPU. In the context of the video, it is crucial to have enough VRAM to support the image generation capabilities of Stable Diffusion, with a specific requirement of 8 GB for the model discussed.

💡Checkpoints

Checkpoints in the context of AI models like Stable Diffusion refer to the intermediate or final states of the model's training that can be saved and reloaded. These checkpoints are used to continue training or to generate images from text prompts.

💡Prompts

Prompts are the text inputs provided to Stable Diffusion to guide the generation of specific images. They can be positive (describing what is wanted) or negative (describing what should be excluded). The quality of the generated images depends on the clarity and specificity of the prompts.

💡Custom Nodes

Custom nodes are additional functionalities or extensions that can be installed in Comfy UI to enhance the capabilities of Stable Diffusion. These nodes can perform various tasks, such as face swapping or pose application, to improve or diversify the image generation process.

💡Civit AI

Civit AI is a platform mentioned in the video that provides a variety of custom models for Stable Diffusion. Users can download these models or test them directly on the platform to improve the quality of image generation.

💡Image Generation

Image generation is the process of creating visual content using AI models like Stable Diffusion. It involves inputting text prompts and using the AI's capabilities to produce corresponding images, which can be refined and enhanced through various settings and additional models.

💡GitHub

GitHub is a web-based hosting service for version control and collaboration that is used by developers. In the video, it is mentioned as the platform where the Comfy UI manager's source code is hosted, and from where custom nodes can be installed into the Comfy UI.

Highlights

The introduction of an easy method to install and use stable, diffusion models through a comfy UI, which simplifies the process for users with low technical knowledge.

Comparing the hard way of installation through Python, which the speaker has tried twice without success, to the easy way through the comfy UI.

The recommendation to use Comfy UI due to its ease of use compared to the traditional method of downloading through Python.

A detailed step-by-step guide on how to install Comfy UI, including searching on Google and downloading the software.

The importance of checking the system's VRAM before proceeding with the installation, especially for users with an Nvidia graphics card or an M1/M2 Mac.

Instructions on how to find out the VRAM capacity by using the Windows R command and DXDAG tool.

The process of installing stable, diffusion models, including downloading the stable, diffusion XL base and refiner, and the file sizes involved.

The explanation of where to place the downloaded model files within the AI documents folder for the comfy UI to recognize them.

A guide on how to generate an image using the installed models, including setting up the prompt, negative prompt, and other parameters.

The introduction of the Comfy UI manager and the installation of custom nodes to enhance the functionality of the stable diffusion models.

The demonstration of using custom nodes such as the reactor and open pose for unique image manipulations.

The recommendation to test custom models on Civit AI before downloading them to ensure they meet the desired quality standards.

The availability of high-quality models on Civit AI, which can be filtered by highest rated or most downloaded.

The process of testing an image model using Civit AI's free image generator before installation, to verify the output quality.

The mention of the preferred think diffusion XL model and its availability in the video description for download.

The overall tutorial's goal to empower users with the knowledge to install and use stable, diffusion models effectively and efficiently.

Transcripts

play00:00

if you never installed or used stable

play00:02

diffusion there is the hard way doing it

play00:06

through python that I've tried two times

play00:09

without success and the easy way through

play00:12

comfy UI so I'll show you how to install

play00:16

comy UI and show you how easy it really

play00:20

is I'll show you how to install stable

play00:23

diffusion models so you can generate

play00:25

images how to use custom nodes to make

play00:28

stable diffusion more powerful full and

play00:30

by the end of this video I'll show you

play00:33

how to install the highest quality

play00:35

models so you can get ultimate control

play00:40

just follow this tutorial step by step

play00:43

so you can install and use stable

play00:46

diffusion step number one install comfy

play00:49

UI so just write comfy UI into Google

play00:52

search and click the first link by the

play00:54

way every single link is down in the

play00:57

description now the reason we want to

play00:59

use comfy UI is it's a lot easier the

play01:02

old way of getting stable diffusion

play01:05

would be to download through python that

play01:07

somebody with very low technical

play01:09

knowledge would have a hard time doing

play01:13

with comfy UI all you have to do is just

play01:15

download a couple of things and then it

play01:17

will work in this node base now you

play01:20

might be thinking hey this looks pretty

play01:23

complicated man but actually when you

play01:25

get into it it's so simple and I'll

play01:28

explain everything to you in a later

play01:30

step so how do we install well all you

play01:33

need to do is scroll down a little bit

play01:35

and you will go to the installing here

play01:38

just click on direct link to download

play01:40

and you will start downloading this one

play01:42

is around 1.4 GB so just wait for it to

play01:46

install now just go through your

play01:48

downloads folder until you find this

play01:50

file which is a ZIP file right click on

play01:53

it click on extract all and extract then

play01:56

you will get this folder I recommend

play01:58

that you cut it away from the downloads

play02:01

folder go to documents make a new folder

play02:04

named Ai and paste it in here this will

play02:06

make it easier for the later steps now

play02:08

let's double click it and here there are

play02:10

two run files that you need to look out

play02:13

for the first one is run CPU and the

play02:16

second one is run Nvidia GPU and this is

play02:19

important if you have an Nvidia graphics

play02:21

card the model we're going to run today

play02:24

needs around 8 GB of vram and if you're

play02:27

running a Mac with M1 two or three I've

play02:31

left a link in the description to

play02:32

download it on Mac as well it's a little

play02:35

bit different but you can still get it

play02:37

to work but how do you find out how much

play02:39

vram you have well just click Windows R

play02:42

and write DX dag click okay click on yes

play02:46

and you can now see what you are working

play02:48

with just click on the display in the

play02:49

top and you can see I have the AMD

play02:51

Radeon graphics that only has 400 MB of

play02:55

vram and I have my GPU Nvidia GeForce

play02:59

RTX 3070 laptop with 8 GB of vram so

play03:04

check your requirements before you

play03:06

continue so now that you know we can

play03:09

just click on run Nvidia GPU it will for

play03:12

you install a bunch of packages so it

play03:15

will take a little bit of time but for

play03:18

me what happens is it opens the comy UI

play03:22

in my web browser but the main issue is

play03:25

that if you've done every single step

play03:27

now you won't actually have any models

play03:31

here that you can use to generate an

play03:33

image so that's

play03:36

why stop taking meeting notes let AI do

play03:40

it for you just get TLD DV for free and

play03:42

it works inside of Zoom Google meet and

play03:45

teams I just had this short meeting now

play03:47

I can summarize main ideas create a list

play03:49

of next action steps or even generate

play03:51

sales rep performance report you can

play03:53

even provide a custom prompt and

play03:55

generate we just got an instant summary

play03:57

you can also use the AI report Builder

play03:59

if you have have multiple meetings with

play04:00

one clients and summarize all of them

play04:04

then you can schedule this to happen

play04:06

recurringly you get your AI report that

play04:08

you can schedule to happen every Friday

play04:11

that then integrates with your favorite

play04:13

tools from slack to HubSpot download TLD

play04:16

DV by clicking the link in the

play04:17

description down below and put AI into

play04:20

your meetings thanks to tlv for

play04:23

sponsoring this video so that's why

play04:25

we're going to go to step number two

play04:27

install stable diffusion the first thing

play04:29

we're going to download is the stable

play04:31

diffusion XL base 1.0 again links to all

play04:35

of them are in the description below and

play04:38

all you need to do is go down and

play04:40

download this one called save tensors

play04:43

now the file size is quite high on this

play04:46

so depending on your internet speed this

play04:48

might take some time for me it took

play04:49

around 30 minutes and all you need to do

play04:52

is click on this download file now I'll

play04:54

show you actually a better model that I

play04:56

like more but this is the original

play05:01

stable diffusion base so if you want the

play05:03

raw unfiltered base this is the one to

play05:06

get now the second thing you need to

play05:08

download is the stable diffusion refiner

play05:11

so I'm just going to scroll down a

play05:13

little bit and here you see the same

play05:15

thing happen we're going to download the

play05:17

first one save tensor and click on this

play05:20

download button again this is 6 GB so it

play05:23

might take some time the last thing is

play05:24

the sdxl V once again just start

play05:27

scrolling down and let's download this

play05:29

one a little lower file size on this

play05:32

just click the download file and if

play05:33

you're downloading all these models now

play05:36

I would recommend also downloading this

play05:38

think diffusion XL model that I'll show

play05:41

you later in this video but if you're

play05:44

but if you're following step by step I

play05:46

highly recommend to follow the link in

play05:48

the description and download this as

play05:49

well once the files are downloaded I

play05:52

need to show you where to put them so

play05:55

let's imagine these are the files I'm

play05:57

just going to cut them then we go inside

play05:59

of the the AI documents click on config

play06:02

UI then click on models then click

play06:06

checkpoints this is where you're going

play06:07

to paste the base and the refiner now we

play06:11

only have the v file left so I'm going

play06:13

to cut that away from this folder go

play06:16

back one step to the models again then

play06:19

scroll down until we find V now just

play06:22

paste your v in here if you've come this

play06:24

far you're doing amazing all you need to

play06:26

do is Step number three generate the

play06:29

image now that everything is installed

play06:32

we just click on run Nvidia GPU again

play06:35

this screen will load for a bit and then

play06:37

you'll open this in your Chrome if it

play06:39

doesn't open automatically just take

play06:41

this HTTP link and copy and paste it to

play06:44

your browser now let's the fun begin and

play06:46

if you think this looks very complicated

play06:48

it really isn't and once you get a hang

play06:50

of it maybe you'll actually like this a

play06:52

lot better than other interfaces but

play06:55

let's start at the beginning where we

play06:57

load a checkpoint since you loaded them

play07:00

into the model folder before you can see

play07:04

that they are now here the base and the

play07:06

refiner so we'll just use the base now

play07:09

you can see this clip path goes up to

play07:11

this clip text en code prompt this is

play07:14

the positive prompt or basically what

play07:17

you want it to make so let's go simple

play07:19

red apple right below it you have the

play07:22

negative prompt this is things that you

play07:24

don't want to be in the image so you

play07:26

could say blur noise and things like

play07:29

this now here you see the image you will

play07:31

generate I have it set to 1280 by 720

play07:35

and the batch size is four meaning I'll

play07:37

generate four Images I'm going to put it

play07:40

on one because it's faster to generate

play07:42

then we go over to the actual K sampler

play07:45

this is what actually creates your image

play07:48

the recommended settings is to go the

play07:51

older sample name steps between 20 and

play07:55

30 CFG I like around 8 to 10 10 and the

play08:00

rest I keep on default now we can create

play08:03

our first image by just clicking this Q

play08:06

prompt now you'll see it starts loading

play08:09

with a green kind of stroke around it

play08:11

sometimes this might load for a while

play08:14

and that's when you can take up this

play08:16

terminal and it will see that it's

play08:19

trying to fetch some data right now and

play08:21

sometimes you might even have to install

play08:23

some stuff so just be patient let it

play08:25

load and now it moved to the next step

play08:29

where it's actually reading our prompt

play08:31

it then has moved to the K sampler and

play08:34

you will soon start to see a bar in the

play08:36

top start to fill as you can see it's

play08:38

downloading some things and just like

play08:40

that our first image is generated the

play08:42

first one always takes a little longer

play08:44

let's try another prompt like a man

play08:46

showing an iPad to the camera and let's

play08:49

Q prompt again this time will be a lot

play08:51

faster and depending on how many images

play08:55

you are generating and the file size

play08:58

this will take shorter or longer just

play09:01

like that it goes into the VA code and

play09:05

we get the new image as you can see this

play09:07

is the quality that you get from the

play09:09

base model and if you're used to

play09:11

prompting inside of chat gbt it takes a

play09:14

little bit of a different prompting

play09:16

style but let me show you some good

play09:18

results with my favorite model in a

play09:21

minute just one more example like a

play09:23

gorgeous Viking woman at the top of the

play09:25

mountain Q prompt it's loading again and

play09:27

here is the final image a woman that

play09:30

looks like she would carry you into bed

play09:33

but is that all you can do with comfy Ai

play09:35

and how do we actually get the best

play09:37

output that's why we have step number

play09:40

four comfy UI manager just go to the

play09:42

comfy UI manager on GitHub because this

play09:45

is where we're going to install a bunch

play09:47

of add-ons and this is by far the

play09:50

easiest way to do it just scroll a

play09:53

little bit down and the first step is to

play09:55

get to the CD custom nodes ter terminal

play09:59

as you can see this is inside of comy UI

play10:02

then custom nodes then you just want to

play10:05

rightclick and click on open Terminal as

play10:08

you can see we're now running inside of

play10:10

the correct folder now just copy this

play10:13

git clone and paste it right in here

play10:16

click on enter and it will take a little

play10:18

bit to install now you can close it now

play10:20

we just go to config UI and click on

play10:23

restart now you can see that we have

play10:25

this manager button in the bottom right

play10:28

and the most important button here is

play10:30

install custom nodes as you can see they

play10:33

have hundreds of different custom nodes

play10:35

that you can install to do different

play10:37

things for you for example if I search

play10:39

reactor this is a node that I was

play10:41

playing with yesterday the fast and

play10:44

simple R like face swap extension node

play10:47

so you can just click on install here

play10:49

then we can search for open pose where

play10:51

you can apply a pose of a character and

play10:54

then you'll actually render out that

play10:55

post for the character once they're

play10:57

installed you can now right click add

play11:00

node and you have your new nodes you

play11:03

downloaded here for example reactor you

play11:06

have three different nodes that you now

play11:08

have access to that have these inputs

play11:11

and outputs for example to use this fast

play11:13

face swap they need an image so we're

play11:16

going to use this as the input image we

play11:19

need to rightclick add node image and

play11:23

load image where I'm going to upload an

play11:25

image of my face something like this put

play11:28

the image into the source image then in

play11:31

the save image I'm just going to drag

play11:33

over this one now we can change the

play11:35

prompt we cue The Prompt you'll now see

play11:38

that it's also having this green circle

play11:41

around it before and here is the image

play11:45

we got yeah we definitely need some

play11:47

prompting help and I guess is this

play11:49

supposed to be me that's why we go to

play11:50

the last step to get higher quality just

play11:54

go to civit ai.com because this is where

play11:57

you can download a lot of custom models

play12:00

and get exactly what you're looking for

play12:03

just click on the models tab in the top

play12:05

then we can filter by highest rated most

play12:08

downloaded and you'll see the top models

play12:11

here I tested a bunch of them and I

play12:13

believe there's one thing that you

play12:15

should do before you start installing

play12:18

and that is to actually test them on

play12:20

civit AI itself say you like this model

play12:22

for example instead of downloading it

play12:25

being 6 GB and taking a little bit of

play12:28

time you can actually click on this run

play12:30

model and go to cart which is a free

play12:33

image generator and now you can just run

play12:35

the same prompt Again by clicking here

play12:37

and test the entire model I'm just going

play12:39

to run it and just like that we tested

play12:41

the model even before downloading it so

play12:45

you can get higher quality images this

play12:48

think diffusion XL I'll leave in the

play12:50

description down below because it's my

play12:52

favorite and once you've downloaded it

play12:54

just put it into the models folder that

play12:57

we did for the Bas and the refin ER so

play12:59

you now know how to install and use

play13:01

stable diffusion like the video see the

play13:03

description below and I'll see you in

play13:05

next video

Rate This

5.0 / 5 (0 votes)

Related Tags
Stable DiffusionComfy UIImage GenerationCustom NodesAI TutorialTech GuideArtificial IntelligenceGraphics CardVRAM CheckGitHub