2024 ComfyUI Guide: Get started with Stable Diffusion NOW

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Applause] comfy UI it's big it's complicated and it looks as scary as an HP Lovecraft Cosmic heart but it doesn't have to be in today's video I'm giving you everything you need to start making amazing art with one of the most powerful stable diffusion UI available installing comfy UI isn't actually that hard but the rest of this process assumes that you have both Python and git installed if you need help with that part check out my automatic 1111 install video popping up now or in the description we'll first need to head over to com's GitHub page and download the zip file once you've done that just extract it using your favorite compression software to a location that makes sense for you now you'll probably end up downloading tons of checkpoint models so make sure to keep disc space in mind what we have here is the portable Windows version of comy UI you can even put this on a pen drive and bring it with you to your local Starbucks just keep in mind that this only works if you're using an Nvidia GPU or your CPU for your Generations if you're one of the brave souls running an AMD card you can check out the GitHub documentation for more information there once you've extracted the files head into your new comfy UI folder in here you'll see two windows batch files one called run CPU and one called run Nvidia GPU this is how you launch comfy UI you'll also see a folder called update inside you'll find a file called update comfy UI and you guessed it this updates your installed to the latest version It's good to check in on the GitHub page now and then and decide if if you want to update when a new release is available back in the main folder you'll find the comfy UI folder in here you'll find even more folders but right now we just want to go into custom nodes in here we're going to install something called comfy UI manager a tool that we can use inside the UI to make life a whole lot easier in the address bar type in CMD and then hit enter in the command box type in get clone and then paste in the link for comfy UI manager GitHub or just copy and paste it in from the video notes hit enter and comfy UI manager will magically appear in the custom nodes folder you can close out of the command box and back up one page to the comfy UI folder to actually make stable diffusion images we're going to need some stable diffusion models I've linked to the base stable diffusion XL model in the video notes but you can download any model you see fit from places like hugging face or civid AI once you've downloaded your models you can open the model folder in the comfy UI folder and drop them into the relevant folder you'll see a ton of folders in here but if you're new to stable diffusion just know that your base models go into the checkpoint folder now if you already use automatic 1111 you can actually use your existing models rather than download them all again to do that head back to the comfy UI folder and look for a file called extra model paths. yl. example right click on it and hit edit with notepad in here you can edit the base path to your automatic 1111 install location note that the path should be to your a1111 install and not the models folder save the file close notepad then right click on extra models paths. yl. example and choose rename just remove the example part of the file name and you're good to go all right it's finally time to launch comfy UI so head back to the main comy UI Windows portable folder I've got an Nvidia GPU so we're going to double click that option here you can run the CPU version if you don't have a graphics card or if you have a lot of time on your hand but just know that your Generations are going to be enormously slow all right comfy is just going to run its first time startup and then finally load into into a browser Tab and you have this but don't worry we're going to go through all the basic nodes to get you started if you don't see this when you start comfy UI you can click load default on the control panel here and it should load the default setup first let's check the control panel window here the Q prompt button will kick off your generation once you have everything set up ticking the extra options box lets you set a batch count for your generation this is the number of times the generation should run the default is one and setting this number higher requires more memory and will take longer Auto q and Q front are options for when you're using comfy ey on a network with others we're running locally so we'll skip these for now view history will give you a list of your previous generations and let you load and delete them from the control panel the save button lets you save your current workflow and the load button lets you load one the refresh button refreshes your workflow and is Handy if you run into any problems after installing custom nodes for example the clip space button is more of an advanced feature which we won't get into here but just know it can be used with certain nodes to make edits on the Fly you can copy an image into clip space make some mask edits and paste it back into something like a preview node to make quick changes mid generation the clear button will wipe your comfy UI workflow clean and load default lets you start fresh if everything went to plan with the comfy UI manager install you should see that button here now too but more on that later all right now let's have a look at the spidery mess lovingly referred to as the comfy workflow you'll notice that the workflow is made up of several nodes with little wires connecting them we've got the basics here but as you progress with comfy you can end up with dozens of these interwoven nodes so let's find out how it all works nodes will have either inputs outputs or both built into them denoted by these little multicolor dots inputs into the nodes will always be on the left and outputs will always be to the right you drag the wires in between the nodes to connect them let's have a look at the load checkpoint node first from here you can choose your base checkpoint model that you downloaded earlier just select it from the dropdown menu we can see that this node only has output which makes sense it's the first one in the chain we can see that the model outputs to the sampler node the clip output connects to the text input nodes and vae output connects to the vae decode node everything is going where it should and only connects to its corresponding color on a compatible node let's look at the clip text nodes next clip stands for contrast of language image pre-training and is what converts our text prompt into something that stable diffusion can understand and then guide the generation the base workflow has two clip boxes although they aren't labeled one is for positive prompts and one is for negative prompts we know this because we can see that they connect to the positive and negative inputs on the next node the sampler if you want you can rename these by right clicking and selecting title okay for our positive prompt we'll put in a fluffy tabby cat in a business tie and for our negative prompt we'll keep the suggestions as is the empty latent image node is where we can set our image size and batch size check the notes for the model you're using for optimal image sizes but for SD 1.5 512 x 512 is your starting point and if you're using an XEL model you can start at 1024x 1024 batch size determines how many images should be generated at the same time this is different to batch count which again determines how many times the generation should run so say we set this batch size to four and batch count to one our generation will run once making four images in parallel if we set batch count to two it will run twice making four images in parallel twice resulting in eight images most of our previous nodes now connect to the K sampler node where the magic happens starting at the top seed is the number used to create noise that stable defusion will then use to generate your image from every single number will create different noise patterns and so the image created will change based on this number control after generation lets you choose what should happen to the seed after every generation so either randomize it increment it or decrement it by one or keep it the same steps is the number of sampling steps that stable diffusion will run to get the image based on your prompt you can play around with this but 20 is a good starting point and know that higher isn't necessarily better it's just different the CFG scale controls how much stable diffusion listens to your prompt for the final image the lower the number the more creative it gets below that you can choose your sampler and scheduler sampling is a pretty complicated topic but just know that each of these options will produce different results and some are better than others I usually stick with DPM PP 2m with Cara scheduler you can play around with these and find one that works best for you D noise tells stable diffusion how much noise to get rid of during the stable diffusion process this can have a profound effect on your final image leaving this at one will probably get you closer to what you're looking for but lower settings do have creative possibilities the next node is the vae decode node vae stands for variational autoencoders and while we won't get into to detail on that here just know that this node decodes everything that comes before it into the final image that we see in our final node which is the save image node so let's put it all together and see our workflow in action what's cool about comfy UI is that we can see all the stages of the generation as they happen once we hit Q prompt or control enter if you're a shortcuts person you can see the stages highlighted in green as they happen you can also rearrange the nodes any way you like to make your own customized workspace to move multiple nodes at once just hold control and click click on the nodes you want to move then hold shift while you drag to move them all you can add to your workflow with new nodes by right clicking anywhere on the workspace and selecting add node from here you can explore all the built-in nodes add them and hook them up to your existing workflow but the coolest feature of comfy UI is that it stores the workflow that created the image right into the image itself so if you find an image you really like somewhere on the internet and if it was generated by staple diffusion you can drag it straight into comfy UI and get the same workflow if you get a bunch of errors when you do this it's finally time to use that comfy UI manager that we installed earlier we'll just hit the manager button and we can choose to install the missing custom nodes that we don't already have once you've installed all the nodes just remember to restart comfy UI and you should be good to go and we can even install models Straight From Within comfy UI from the manager you can also update comfy UI with one click rather than digging into the folders discussed previously and that's it you're now ready to go forth and create horrifyingly amazing workflows and comfy UI but before we go let's run through a simple example that shows how powerful comfy UI can really be let's start with the basic workflow I'm going to enter the prompts in the boxes provided as normal let's say that I want to mix things up and add some luras I'll just click anywhere on the workspace then add node then loaders then load Laura I want to use two luras so I'll right click on the Node and hit clone now I'll just choose the luras I want to use and set their strength next I just need to hook them up to my base model and connect them to each other then we'll connect the luras to The Prompt boxes and then to our sampler now I'm just going to run this quick to make sure everything is hooked up properly and yep it's hitting everything it needs to but let's say I want to upscale the image right here in the flow well again I'm going to right click anywhere look for latent then upscale latent I'm going to enter my settings in here now upscaling requires another sampler so again right click add node sampling and I'm going to add another K sampler we'll just set the seed to zero and fixed and drop the D noise to.5 so we don't have too much of an impact on the final image composition now I'll hook up the upscale node to the old sampler so it passes the job to the upscale node and then the upscale node to our new sampler and finally that node to our VA code still with me okay let's see if that works nope we need to connect the model and the prompts to the new upscaler node so negative to negative and positive to positive and we'll pull the model in and there we go so we can see that the job passes through the first sample then through the upscale node and then sampled again and now we have an upscaled image what if I want my upscaler to use a different model we can do that right click add node loaders load checkpoint select a new model then hook that into the sampler node the line to the original node disappears and we're now using the new checkpoint for the upscale cool right what if I want to get even more creative and have the image processed by two models before it hits the upscaler right click add node loaders load checkpoint that checkpoint is going to need a sampler so right click add node sampling and this time we'll go k sampler Advanced hook up the new model to the sampler then the prompts then pull in the job from our first sampler then hook up the new sampler to the upscaler all right let's roll it we now have an image sample from three different checkpoint models using two Lura models and upscaled allinone workflow if you want to try this for yourself I've added this workflow as a PNG file Linked In the description I hope that gives you an idea of how powerful comfy UI can be with a bit of practice let us know your comfy UI tips in the comments down below thanks for sticking to the end of the video like this video if you found it helpful and there is so much more to comy UI so hit subscribe to catch more videos like this one coming soon [Music] a
Info
Channel: Incite AI
Views: 6,964
Rating: undefined out of 5
Keywords: comfyui, comfyui tutorial, stable diffusion, staable diffusion tutorial, sdxl, stable diffusion sdxlm, comfui install, comfyui guide, comfyui img2img, a1111, automatic 1111, how to comfyui, how to stable diffusion, ai art, midjourney, sampler node, comfyui upscale, comfy ui, comfy, comfyui ai art, comfui, ai art generator, civitai, hugging face, comfyui troubleshooting, comfy ui guide, comfyui help, comfyui workflow, comfyui 2024, comfyui sdxl
Id: f_VPjoUXvn0
Channel Id: undefined
Length: 13min 7sec (787 seconds)
Published: Thu Jan 18 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.