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

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
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. this and we'll use the Keras scheduler to try and move faster than the normal one um and there we go so we'll hook this latent now we can't hook it into this because I collapsed it so I want to right click uncollapse it like this so it's going from here to here here following here right okay so let's try this prompt and you notice that it started here because this is where it changed the seed and then it doesn't go all the way back to reload the model every time so this could be a lot faster okay and you'll find what we do is we would move these next to each other so we can compare them so you see what we started out with in the quick rough sketch of steps and then we obviously improved upon that down here so I want to do is I'm going to borrow this number just to make sure I keep it the same one other cool trick by the way if you notice we have two different seeds here and although that's cool in this situation what if I don't want them to be different and I don't want to hit sit and copy and paste seeds one other cool thing you can do is you can turn certain values into inputs so again if you right click on something you see down here it has all these we can do convert noise seed to input and you notice that noise is now gone and it's here we can do the same to this one so we can do convert noise seed and for seed to input there we go what I want to do is I want a what's called A Primitive so I can right click add node go to utilities now I have utilities you probably won't have but that's fine you'll see primitive is always here and there we go so when you connect it to something that's going to figure out what it needs to do oh it needs an integer there we go and I can dictate whether it's fixed I can say randomize and so on just like we could down there in this case I'm going to replace this with the number that I liked and then again grab this and enter and drag it down here so now we have one place where we can change the seed for everything we work on if this is going to be randomized by the way and I don't want to look at it anymore again I would just collapse it because we don't need to fiddle with it constantly same with this one I tend not to collapse a lot of these but if I'm just trying to get them out of my way I'll collapse them and stack them into all kinds of crazy things and you do what you want to do to minimize your wireless driving you nuts but it's just an OCD exercise so click prompt do it again this time it's going to use the Primitive so the seeds are the same in both noises not that that matters because you can use different seeds obviously we did it and it worked fine now we can do this again and again creating different steps and sampling the data in different ways in order to get the images that we love I think this is so incredibly powerful so this is your introduction to company so take a take a look at it install it I'm not going to do the installation just go to the get and download it it's that simple it works on pretty much every PC even an old M1 Mac where automak 1111 tends not to work on some of those older ones no it will be slow you can also put it in CPU only mode if it doesn't detect a GPU it will go into CPU only mode for you so it's a lot smarter I like the fact that company actually works with us at stability now so if you didn't know this you can actually drag any image that's been created in comfy directly into the graph and it will load it for you including the seeds so it's a really powerful way to load work from previous images you've been working on to continue going forward when by the way we talk about the queue we didn't talk about queuing the prompt very much but if you just go up here you can hit Q by the way then you just cue a bunch of these so if you want this to run a whole bunch of these things now note that I'm not saving these images they're only previewing in order to save them we would actually use a save node which I did not do but now you know how to do that yourself so anytime you want to save it you would just go ahead and either click on it here and hit save or again I would use the save node and again if you can't find it you can always drag it out from one of these other things like let me decode here drag it out and you'll see that it will have save image here if you don't want to try and find it in that menu so let me know what you think in the comments below if you have questions or comments we will do a few more videos on this because we're going to do a whole bunch of different stuff but I thought this was a pretty good introduction as to the workflow so you understand the basics of how to use it you can sit in OCD around your graphs and get your noodles to be all the way you want them to be and kind of come up with your own little workflow and as new models come out you just change the model over here and the workflow will all fit so there you go everybody thanks for hanging around with me today let me know what you think in the comments below getting back to making more videos again obviously been very busy with the release of different models and doing different Q operations and I want to keep you up to date with things I'm also thinking about starting a podcast because obviously I get to know a lot of information that I want to pass on news and information I think I'm pretty interesting so I'm going to get the whole membership thing back up again I appreciate the people so much who stuck through this whole time when I wasn't really making many videos although I did get a lot of questions from them and I was trying to be as interactive as possible so we're going to get that right back up and those people that are stuck around all this time I'm going to make it up to you we're going to get a whole bunch of stuff going inside of there and a lot of these uh images that I generate inside of comfy again you can drag those right into the graph and it'll load it I'm going to start to kind of make that a thing that I'm going to do as well so I'm going to create some pieces of art that I really love drag them out there and then let the patreons load those in they're not patreon by YouTube members so everybody thanks again and I'll talk to you later Everybody Take Care stay safe and catch you next time
Info
Channel: Scott Detweiler
Views: 61,725
Rating: undefined out of 5
Keywords: stable diffusion, ai art, ai art tutorial, stable diffusion tutorial, comfyUI, comfy ui, automatic1111 alternative, midjourney alternative
Id: AbB33AxrcZo
Channel Id: undefined
Length: 19min 1sec (1141 seconds)
Published: Thu Jul 13 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.