XY Plots - The Basics - Stable Diffusion (ComfyUI)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome back in today's video we're going to try to do some XY plots with comfy UI and in order to do that we're going to need to have three different extensions and you can choose which extension or let's say custom nodes is your preference but I'm going to show you all three so open up comy UI and make sure that you have of course updated to the latest so you can click on this update all and then restart your comfy UI once you've done that come back into the comfy manager click install custom nodes and go ahead install the list of custom nodes that you see in front of you the one that will give us the XY plots is the efficiency nodes the tiny Teran noes and the comfy roll these are the three extensions that will will'll be looking at today uh just be careful that you're installing the correct efficiency nodes CU there's this um big red notice here that the original repo uh is no longer maintained and a new maintainer is helping us keep the efficiency nodes if you ever wondering what happened to the efficiency nodes this is what happened we have a new version um from Jags 111 so once you have that installed uh you'll notice here you've got the uh efficiency nodes menu here you got the ttn that's the Tiny Terror and then the comfy roll in your menu okay but before we actually put together a workflow I want to give you two tips okay all right the first tip tip is something that's helped me a lot recently so if we load default workflow here you'll see you've got these these nodes and you know you don't know where they came from did they come from something out of the box or did they come from an extension you have installed so this cool little trick if you go to the manager and there's this badge here that's set to none by default you can pick something other than none and like I chose # ID nickname when you do that you see this little label or badge up here on the top of each one of these nodes and that's really really helpful because now you know or at least it gives an indication of what extension that comes from and just to make it clearer B into efficiency nodes and I said efficiency loader you can see here that the badge gives me efficiency noes and that really helps me a lot uh especially when working with these these custom nodes and this big noodle uh space right so I hope that first tip helps you then the second tip is if you went ahead and installed the custom scripts over here that gives you a way to save your workflows so you can now right click on the empty canvas workflow image export as PNG now that gives you a way to export this workflow as PNG okay uh that's different to the save here like save is Json that's just a tip two all right so let's go ahead and start to do some XY plotting first one is the efficiency nodes so let's clear this up and of course you can double click and search or you can use the menu but I'm going to use the menu just to show you where everything is so I click on efficiency nodes loaders efficiency loader this is the loader for our checkpoint and our positive prompt and negative prompt sorry positive prompt and negative prompt got a bit tongue tied there and then also we have to of course have a sampler so we add a node efficiency node and the K sampler now we just need to drag these up so drag them to the correct corresponding left and right okay and then of course we've got uh this little image over here on the on the output so we can drag that out and if you want to save the image you're welcome too but for this demonstration we're just going to prev the image now as it stands now this should work just make sure okay awesome it does work okay but obviously it's not what we want to do we want to be doing kind of XY plotting here so what we want to be using is this script here so if we add a new node and we click on scripts we have this XY plot script so we can connect the script to that script and these dependencies to these dependencies okay so just knat it up a little bit now we want to control our XY values over here and just for the demo purposes we want to say let's say the x is our CFG SC scale and the Y is our sampler so if we add some XY inputs you know they give you various ways Uh custom nodes for the inputs so we'll say CFG scale is our X and sampler is our y okay so what it's saying here now is uh batch count is three so we want to go s 8 and n and then for the sampler we we need we have three Samplers you can increase increase Samplers by going and changing this input count we just say ula a and we'll do DPM Plus+ and we'll do this one okay so that's our X and Y and let's preview that all right so there there it is there our our image uh rxy plot very very nice and also noticed something I don't know if anyone's aware um but there's this 1 to9 button here if you click that you can cycle through the images or if you click the cross it gives you your uh individual images as well as the preview uh one thing I want to go through extra on the efficiency nodes is right now the decode is set to true if you set this to false then this is not going to work you will need to actually have a decode here and then do that okay so let's just make sure that the Bae decode is true if you want to just parp out the the image directly okay all right so now let's just reset that back that true all right one more thing I want to show you here is is they do have some documentation on this so if we look over here they have this manual XY entry info and it gives you a bunch of examples on on you know what type of inputs you can choose and you can copy paste from this list Samplers schedulers vaes and so on um so that's one way the other ways and the reason why there's this manual info is if let's say I don't want to use this particular one I want to do it manually with a like a multi-line you go here and you can say input this one yeah manual XY entry okay and what I'm going to do is I'm going to just swap out this okay and I'm going to choose the sampler and now I have to put in the sampler here all right and the way we do that is just make sure I have it correct so it says that we have to put a semicolon between each one of them okay so if I did that that should work let's see if this works now yep okay great so that works so if you prefer the manual entry versus the more um graphical text uh graphical control widget then you can use the the manual entry just make sure that you have semicolons between each one of them and I think new lines also work so you can do something like this let's double check yep okay awesome all right so that's how you do XY plots with effic efficiency nodes okay let's try the next custom node uh example which is the Tiny Terror example so clear this out and let's look for the Tiny Terror so we add a node ttn is the tiny Teran nodes pipe pipe loader okay so s thing gives us our checkpoint and it gives us our positive negative prompt so let's put that in okay and then we need a sampler so we go back here and we pipe case sampler that's the one we're looking for now a lot of these are optional so you just need a drag from the pipe to the pipe which is which is quite nice and again they have a image output so we can preview the image and if we look at that as it stands just again making sure everything works okay awesome okay does work let's now use this XY plot over here so what we do is go back to this pipe and they have this XY plot drag that there and then here in the xaxis and the Y AIS uh we have to choose what we want so we can say CFG is here and on the Y the sampler name now the syntax very explicit on this one all right you have to have semicolon and space okay so we can do seven semicolon space you don't put the space uh it doesn't always work so here is our samp and that should be it for the tiny Terra Q then up and there we go XY plot with the tiny tiny ter felt a little bit easier and simpler than the actual uh efficiency noes but I think everyone's more familiar with the efficiency nodes than the tiny terra terra nodes all right last up is the comfy roll okay and this one's going to be a little bit more complicated but let's see if we can get through that okay so we need to clear out our workspace and let's start with our our loaders right for this we'll use the efficiency loader and the efficiency Cas s so let's just get this all linked up okay and all right make sure we selecting the right checkpoint and we have a positive negative prompt oops okay and what we're going to do is we're going to try to control the CFG value and this sampler value so in order to control them we need them as inputs so go ahead right click on here say convert CFG to input convert scheduler name to input okay that's just preparing us to get these as inputs okay uh and now we need some custom nodes which are the comfy roll nodes so let me just get them onto the canvas so if we add a node comfy roll XY list it's the start then we need from folder and I'll explain a little bit as we go along okay and I guess one more I think it's [Music] CR image output this one okay very good right so the way this works is we we're going to use this X and Y over here um so let's say we again X will be our CFG so we'll say 7 comma 8 comma 9 and me grab my Samplers and this y will be the Samplers so what's going to do is going say at index one it's seven and then at index two eight at the index 9 and it's going to repeat that for each one of the Samplers so it's actually going to run nine times or yeah so 3x3 all right so it's going to run nine times so what we want to do is we want to make sure that this index changes or Cycles through nine times okay so in order to make that index cycle nine times we have to um be able to control it in some ways so I'm going to convert that index to an input then I'm going to add a primitive node and I'm going to connect these two up going to start at one but then over here I'm going to say increment and so what really control after generation means that when you go to this extra options here on the menu and I say nine here B count 9 then those values going to go from 1 to 9 each time okay and that means this will index will change from 1 to 9 I hope that's sort of clear all right now we want to connect all the trigger points on each one of these we we just need to join the triggers so uh let's make sure the triggers are inputs on each one of them okay and now let's connect those up so this trigger goes here this trigger goes here and this trigger goes there okay now we want to make sure we connect the images so this image goes to there and this image coming out of our K sampler goes into this output okay all right so we're almost there uh basically the flow is starting here with our trigger point running through a 3X3 grid and outputting each of the images into a folder and then once the images are in a folder we will combine those IM images into a grid so that's kind of how this comfy roll workflow works okay I do like to keep my images as PNG so just making sure that these are PNG okay so far so good um what we're missing is right in the beginning we converted CFG and sampler name to inputs and we want these X and Y to go in there all right so if I drag this x out and I just let go here in empty space it tells me X is a string I do the same thing with CFG tells me CFG is a float so somehow I have to get uh this this x converted and what you can do is just search for a string to number and then comfy roll gives us this conversion so CR is comfy roll so me start there and we know that c is a float right cuz it told us a float so we can say this goes there that's a start um but the text there's no input yet so we have to convert text input now we can take this x here all right so we have the CFG next is sampler name sampler name I drag that out tells me it's a combo okay and of course this should still be string all right so Y is a string so let's search for string to combo this one and thankfully they have TT as as input now put that there and then this any goes to the sampler name all right so we have our X and Y going into our sampler we have all of these okay all this ready just going to refresh for a second okay all right the one thing I want to show you is comy all image folders are a bit strange in my opinion but this is how it works if I want to change this value I can't right now input folder it says demo yours might be undefined or it might be null but I'm double clicking I'm clicking the arrows and you know I'm getting nothing right um even this output folder I can't change it so the way this comfy R Works which was kind of hard to find out initially but you you got to go to your your comfy UI folder you to go to output and you to create the the folders here that you need so let's go ahead and do that so I put two folders in here one where I want the individual images and one where I want the grid okay once those folders exist you can refresh your browser don't have to restart company you can just refresh your now if I click on this it pops up and actually shows me the two folders okay so just keep that in mind you need to have the folders pre-created for you so here we want to set this as the demo all the individual folders and the output as the as the grid and then here this um you just want to change as well so you want your file prefix to include the folder we have demo backlash there okay and I think that's it I'm also going to change this to save so it saves the file but let's actually try this oh wait sorry before we go um this is a 3X3 grid so we have to have to tell it here what that means so we're starting at one we need to go to 9 and the number of columns we have is three now we can cue The Prompt okay so it creates the grid and I think here we actually have the grid too right so now your your folders have the individual images and the grid so so far so good uh I don't know if this is a bug with the comfy roll but it doesn't actually show the labels on the X and Y AIS so what is what is the CFG and what is the sampler name it's not showing them I'm not sure I've done anything wrong but if you know why it's not showing please leave a you know comment comment for me um so I can fix this this workflow and I'll leave all the links in the description below but that's all for today and I hope you enjoyed it if you want to learn more about stable diffusion and comfy UI check out the links Below in the description as always please support this channel by subscribing and clicking the like button below
Info
Channel: Diffusion Tinkerer
Views: 734
Rating: undefined out of 5
Keywords: #tinkerer, #ai, #art, #diffusion, #stablediffusion, #comfyui, #generative, #txt2img, #img2img, #civitai
Id: Dyd2bEkywsg
Channel Id: undefined
Length: 24min 54sec (1494 seconds)
Published: Wed Dec 27 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.