ComfyUI - Getting Started : Episode 1 - Better than AUTO1111 for Stable Diffusion AI Art generation

260.92k views4390 WordsCopy TextShare
Scott Detweiler
Today we cover the basics on how to use ComfyUI to create AI Art using stable diffusion models. Thi...
Video Transcript:
hey everybody Scott dot Weller here today we're going to learn comfy UI this is what I consider to be the best tool out there for AI art generation at this time you can do everything that automatic 1111 does and a lot more so from your control Nets to your Loris to training models it can all happen inside of this so a company actually works with us at stability. ai so I work there as the head of quality assurance so kind of working with this on a daily basis and I find this to be a very powerful tool and I want to introduce you to it I'm going to put a link down below for you to go and install it it's just a simple git and it runs on pretty much every computer that has more than three gig of video RAM in fact it would even work on one with just CPU although it is slow so this is going to be the first of many videos so you can kind of get used to the process in the workflow and especially with SD Excel about to come out this is really the tool to use now I'm sure people will have one that will run an automatic 11 but again you're going to see in here why we use this tool because there's so many different things we can apply in our workflow that we can't just do inside of one of these very easy workflows like automatic 11 11. now there's nothing wrong with that product and I still use it personally but as I start to use this tool I kind of stopped using automatic 1111 except for certain situations and those situations now are getting to be pretty specialized because this tool again can do everything so we're going to talk about that so here we go okay let's get down to business by the time I'm done with this you're going to understand why we use this over automatic 1111 or invoker anything else out there there is so much capability here and it can do everything those products can do and a lot more so let's get to it now rather than walking you through some sort of Grid or graph that's already done which I don't think is very helpful let's just start over and we'll build one from scratch because there's a lot of tips and tricks in here that I think that you'll love so I'm going to hit clear and we'll start over so first of all to add a node to the graph you have a couple of different options one you can right click choose add node and we're going to do a loader and then we're going to load a checkpoint so obviously a checkpoint is your model you know we're used to seeing around so we just load it that way now a couple other options for adding these and I'll show in a second but what you want to do is just select a model that you want to work with so we use one of the dreamlike photo reels from Civic and we'll start there all right so now we want to do something with this we have basically a few different processes we need to apply prompts to it we need to sample from that and then we need to encode that back into an image so we basically have three different steps that we have to do so we have again what's the next step well we need to get the prompts so rather than kind of looking through this and trying to find the right thing by the way I may have nodes here you don't have and there's going to be a lot of custom nodes we're going to add to this product over many many videos because there's so many of them that are very amazing and again they're coming out every single day but again we have we get to pick and choose which ones we want to use well Ren kind of hunting and pecking through here we have another option you can double click and then you can type in what you're looking for in this case we are going to want a case sampler and since I used it last it's going to be at the top here but you could sample you could type in sampler at the top and it would show you we have sampler an advanced case sampler which we're going to use both in this case I'm going to show you one other way here and this is the most convenient you can basically clip clip click on clip and drag it out and let go and it's going to say what do you want to add here because it's paying attention we can add a node and which is going to take us to that again that menu or we can look through what we have in here and sure enough clip text in code is what we're looking for well there we go now we're going to want two of these one for a positive prompt and one for a negative prompt keep them straight I'm going to right click on it choose color and then change this one to Green this will be my positive prompt I can also right click go to Properties or go to title I should say and in here I can put what I want to change it to let's be my positive prompt here I would highly recommend you do this because these graphs are going to get complicated quickly and although a prompt like this sticks out a lot of these smaller ones may get lost in the mix and you'll be trying to find where you are and this can get weird because these graphs get gigantic if you have a complicated workflow so now I want to duplicate this you have again a couple different options one you can right click and choose clone this is the way I would not recommend you do it because that's painfully slow you could go in and try and find it in here again which again is painfully slow you have the best option which is control C or command C on your Mac to copy and we'll want to paste we want to hold down the shift key when we do our control V or command V oh so this is Ctrl shift V we'll place it back in here but it will keep the connections outgoing and incoming in place so this is a very convenient so this is the way I want to do this now I want to show you one other way which I think is even cooler but it's not as interesting if you don't have or it's more interesting if you have no connections and then just simply hold down your Alt key when you click and drag and it will duplicate it quickly so this is a very fast way if you have things that don't have to maintain connections so there we go now we want to change this one change the color of this one to red and we're going to right click and choose title and it'll be our negative all right so now we have that done what we need to do next is you need to sample uh from this clip the conditioning that it's given us and start to work with the model so we can again click on this and drag it out and sure enough okay sampler is one of the options here so I'm going to use this and you see it's already connected to the positive force we're going to use the negative here we need a model well we have a model right over here so we'll drag that all the way across here connect it we'll make that line as straight as we can because we are OCD all right so now what we need is a latent image and a latent image is basically going to be all the noise we're going to feed into the sampler and then use the model in clip conditioning to create the image so uh we want to get this the same way we've done a lot of other things you can actually double click or let's use the menu for one so go add node latent and we go to empty latent image and there it is and we'll leave it as a 512 by 512 but I'm going to show you how to upscale this as well and so we're going to drag this latent here all right now we've got a couple different settings in here by the way your mouse wheel will scroll in and out so that's very convenient we have a seed of zero and you see that after this generates it's going to randomize the seed if you love a seed that you have you can change it to fixed and it won't change it again it will update one more time let's just realize that you may want to copy this seed before you uh click again because it may choose one more before it goes to fixed the number of steps we'll say 20 or CFG classify free guidance is set to eight the sampler we want to use is Euler here and then we want to denoise of one why do we want to denoise of one well we're taking a basically a latent image here with noise in it we want to replace 100 of that noise with the sampled versions of the the condition model okay now from here we have a latent what we're going to do with that well let's find out let's drag it out and we need to be AED code this is the last step let's take the auto encoder and usually your model will have an auto encoder embedded in it if it does not or you want to use a different one again you can go and there's all kinds of different things you can do so you can load in Laura's you can load in different types of things but there's a load vae if you have a specific vae you'd like to bring in you can do that as well in this case we're just going to use the vae from way over there and put it over here now for nodes like this that don't have any numbers like these or things I want to tweak this doesn't have anything tweakable to kind of minimize it I would right click and choose collapse this makes it something tiny that I really don't have to deal with and I can even hide this in different places all right so we do need however to access the last node on it here so before we collapse it we'll grab the image now we want to save this image as well as preview it if we preview that does not save it but if we save image that will save and preview so just note that there's two different things if you want to look at the steps as you're going along then I would use preview and again now we can collapse this one and some other applications actually dock their nodes next to them like this and this is how I can do these graphs if you hold down control or command and drag a rectangle then shift click you can move things together which is really all right so this looks pretty good what is it that we're looking for looking for a box of rocks which tends to be my sample prop for almost everything and a bag of noodles and a bag of noodles as our negative just because I put something in there and I always find that a negative prompt is interesting uh it's kind of think of the negative prop as the antithesis of what you're trying to create rocks are not like noodles so I don't tend to put like I don't extra hands and things as a whole there's a whole mess of why that stuff is kind of silly but I usually just put something for example these just be something soft for example or squishy I would put that in here then he'll be prompt and you notice that it picked a random seed here you'll notice that is highlighting this in green this is where it is working currently and what's interesting about this process is that it will only start the next time we hit Q prompt it's a thing that changed last so there we go a lovely box of rocks just exactly what I was dreaming of there we go and we can make this as big as we can and you'll notice that this is going to be the 5 12 by 512 so there we go we can kind of Squish that down so it's displaying it in real size here you can also right click on this and save the image directly from here which is nice so if we save it we'll throw that up there now let's go back and play with this a bit to kind of get a bit more advanced because this is this is which you can do an automatic 11 11.
this is our Point of Departure but we can do all kinds of crazy stuff from here for example let's start with the image itself this is fine but it's a little noisy and I'd like to make it bigger I want to resample this so let's do that so I'm going to control click and then shift click and move these over and I'm going to want another sampler but I'm going to want the advanced version of the K sampler so we're going to add node sampling in the advanced case sampler why do I want the advanced one well it has a bunch of other settings we're going to want to utilize here so I need the model again so I'm just going to grab the model actually I don't need yeah look at my inputs model I need the positive prompt I need the negative do you see why the label these things it's becoming a little bit of a skip spaghetti Fest here and then we need a latent now we're not going to use the empty latent we've already replaced the latent with the sampled version here so we're just going to drag that here so by the way if you find yourself using these things all over the place if you drag one out and let go you can actually use a reroute node the reroute node allows you to kind of use this to do different things so this allows you to kind of neaten up your graph a bit if you've got a lot of things that are pulling these all the way over here for example then we may want to use that right so what do we want to do in here why did we want this well in here we don't want to do 12 steps or 20 steps to start out with let's just do something like 12 steps because think of this like an image to image where I'm doing just 12 steps to kind of rough in what I want so that I don't get extra arms and legs or double heads or all that kind of stuff that people try and use negative prompts to fix but isn't really a problem with negative prompts we'll get into that another day but in here I want to to scale this up well I want to scale the latent I don't want to scale pixels I want to scale the latent so let's go in here node and we can do okay let's just double click here we want to upscale and we have upscale latent by in this case we can do it by scale so we're going to update we're going to so we're going to upscale this by two so we'll grab our samples here and drag it in here because this is what it's just sampling from that latent what's it want to do it wants to shove it into this place so we basically put this here in the middle so we're upscaling it by two so this would be a 10 24. in twice the size of this 1024 but what I want to do here is again I have it roughed in over here because you saw this by the way you can do fun things like this which I think is it's pretty interesting if we take um let's take these two things and we're going to move them down here so I'm going to put my image in here I'm going to put my my samples which is this latent I'm going to grab this vae from over here so what this is going to do is it's going to generate a preview of what we're doing here so just 12 steps and it'll show us what that looks like but over here I want to start at step 12. and this is where we get that's so much better than automatic 1111 I can use multiple Samplers at different times in different ways so here for example my scheduler is set to normal this is what you would normally start out with but now I want to try and get as far into the step process as possible so I would change this to something like exponential or Keras Keras by the way Euler if you don't know who he is he's a German mathematician live like I think the 1500s brilliant man still use a lot of his stuff today obviously in science and then Keras is actually a scientist who works at Nvidia so a lot of those things are because of his brain it's very cool of him to be someone that has inventing a lot of cool math as we're doing this stuff all right so from here what I want to do is I want to take in start at step 12 and I want to go to say maybe step 30.
Copyright © 2025. Made with ♥ in London by YTScribe.com