Use these tricks and techniques to take your ComfyUI diversity to another level!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone in this video I'm going to show you some techniques or or nodes that I really like using in comi and they really take it to the next level they make the work with Ki much more flexible and much more Dynamic and it allows the variation of your generations to be much more easily managed and let's not waste any more words and go right ahead so as always we're going to start with the default layout just by clicking here the load default and what I am going to do now is select the stable Fusion XL base model and on the width we're going to change it to 1034 by 1024 which is the native or the default size of the stable diffusion XL model and in here I'm going to write down a simple promp that will be a photo portrait of a beautiful cat and here on the steps we're going to do 14 steps which is enough for our purpose 6.5 on the CFG and I'm going to leave it on uer and Norma right here we have the save image note which which basically once I click the Q prom it automatically saves the results into the confy UI output folders and what we're going to do now which is the first thing that I want to talk about is talk is click the extra options checkbox and once I click it I have two options here the first one is batch count and the second one is autoq so we we'll start with the batch count what the batch cou there what the batch count allows you to do is simply replace the need to press several times on the Q prompt button so let's say that I want to create 10 variations of this photo portate of this beautiful cat instead of clicking 10 times on the Q prompt I can simply say do a batch of 10 generations and click on the Q prompt and once I will click the Q prompt you will see that the Q size becomes uh large it will reach to 10 and in the output folder I will see all the images that were generated in this run what I'm going to do here is change the fin name prefix to cat this way all the files that are saved into the output folder we have the cat prefix in their file name and let just click the Q prom and then we'll be back once it's done running for a few minutes so you can see the Q size is now at 10 and the entire process will start running will be back once it is done and you can see I have here the last image that was generated in the batch of 10 runs but if I'll go here to the view history you can see here all the history of the 10 Generations that were running if I'll click load of any of them it will simply load the SE number and the final output image that was generated so this is one way to look at it the second way is to Simply go to the comyy output folder which is on the root folder then I'm going to go to confy UI once again and in there I will have a folder called out once I'll go inside this folder you will see all the 10 images that were generated during the last batch run that created and you can see that indeed it generated the cat prefix for each file name so this way if I need some variation instead of having to click manually let's say that I want to create now 100 variations instead of clicking 100 times I can simply run it for a batch of 100 go to a cup of coffee and take a quick shower maybe and once I'm back I have all the 100 uh images waiting for me to continue working for our next feature we're going to start once again with the low default but this time instead of choosing the stable diffusion XL model we're going to choose the lighting two steps and here we're going to make it also 1024 by 1024 and foring portrait all us cat and here instead of 20 steps we're going to go with four now I know it's called the lighting two steps but two steps are not really giving us the proper results four steps gives us a bit more details that we can actually use that image in the CFG when we're dealing with fast models it's usually a very low CFG so we're going to go with 1.1 one we're going to leave it at uler and normal and for our example we're going to make it on a fixed control after generate because we don't want the seed number to keep changing every time we run it and the reason we do it is because we're going to use here the auto que and the auto que simply keeps running and running and running and we'll see how it happens another thing that is usually very smart to do when you're dealing with the auto que is to delete the save image and change it to preview and the reason is because it keeps running uh uh and and it saves image every time it runs prompt and it can pretty quickly clutter your computer uh with tons of images so I usually do a preview image and once I get to the results that I want I use the either save it manual or only then I add save image node and when we checkbox the auto que we'll have two options the first one is instant and the second one is change what instant does it means that it will simply keep running nonstop every time it completes a generation it starts another one again this is nice if you want to let it run indefinitely indefinite number of times for example I want a a number of variations of this photo and I just want it to keep running until I see something that I like uh what I usually usually use is the change and the change only runs when it realizes that there's been a change in the workflow either a manual change or an automatic change this is the reason why we change the random seed to a fixed seed because each time a generation is completed the random seat changes the seed number and this would have caused the auto que to see a change in the interface and run it again and we don't want to do it let's just give it the first run and then you will see how it comes into action when you create changes in the interface so let's give it the initial run and now it's on the auto que meaning that every small change that I'm going to do on the interface would automatically start running the flow so if for example now instead of four steps I want to do five it's enough for me to change the number of steps and immediately sampler will start running once again this way I can simply start playing with the prompt or with the number of steps and things like that so let's leave it at Five Steps it seems to give us nice results and now we can simply play with the results instead of cat I want a dog we can add words and it gives you a very intuitive and dynamic way of generated prompts and this way every change you make to The Prompt directly impacts the generation and that includes everything in the workl so even if I now want to change the size once I click enter it will start running again I hope you can see the power of this feature it is it is especially useful when you're dealing with control net you can plug in Custom Image into the workflow and every change you make to the image will immediately render the new image based on that change it's very nice the next thing I want to go over with you the next thing we're going to go over is something very efficient when it comes to generating a mass of generations or if you have several options and you want to test them all out uh it's something similar to creating a grid but it works a bit different and it's called Dynamic prompt in order to use this node we will have to install a custom node it's very rather simple just click the manager and install custom nodes and in the table that shows just simply type Dynamic prompts and there you have this Dynamic prompts custom nodes you need to click the install once you click the install it will take a few seconds to install this custom node once it is done it will ask you to restart the comi interface clicking this restart button we restart the comi interface and reload all the required nodes now besides installing the custom node for the dynamic prompts another custom node that I like installing when using the dynamic prompts is called show text or it actually calls custom scripts But it includes a nodes that called show text and I use it in order to see the dynamic prompts output on the search we'll simply type show text and we'll do the search and here there is this confy custom scripts we will install this custom node as well and it will allow us to show a text you can see here all the kind of nodes that it provides and here we have the show text node that allows us to see the text that the dynamic fromont nodes will be generating once again let's click on the restart and wait for it to restart the interface so now after we have these two nodes now let's see how we can use all the custom nodes that we've just installed and we'll start by selecting on the checkpoint I'm going to select the twostep lighting just so it will run faster and to save time I'm not going to use the text box inside the clip text in code because I want the dynamic prompt note to generate the text for me and the way to do it let's move it here the way to do it is to add here something called combinatorial prompts so this is one of the nodes that the dynamic prompts provide there are several nodes they provide they all work pretty much in the same way but the results are a bit different I will put the link to this custom node in the description and there you have a pretty detailed information how you can use each one of the nodes but what I want to go over with you is on the overall way to use it it all works kind of the same with minor differences so once we put the combinatorial promp we can put a regular pront like that for example a portrait a portrait photo beautiful cat like we did before but this time we want the word cat to be replaced with different words each time we run the generation so I will do curly brackets and here I can do cat enter a pipe and say dog pipe bird pipe Mouse pipe and we'll take a shark for example and this way it will generate a different prompt each time I click the C and now comes into play the custom node that we just installed that can allow us to show a text and here I can simply drag the output of the string and add the show text node this will actually show me the text that this com Boral prompts generated now I want to connect this prompt into this text section and the way to do it is rather simple it works the same for all the nodes on confy UI I can simply right click on the title of the of the node and here on the bottom I have convert text to input if I'll do it here on the empty lated image for example you will see that I have con convert width to input convert height to input and so on and so forth basically it means that I can take each parameter here and convert it into an input where I can now connect my own custom node so we will right click do convert text to input and now you see that instead of builtin text area I have this text input and now I can simply drag the output of the combinatorial prompt string into the text and this is what the clip text in code will receive as text input now let's change the number of steps to four for example we'll do a 1.1 CFG once again that because we're using the lighting the table and here let's change the side to something about 760 you know what we'll leave it at 512 and we'll do it by 768 and just to give it a portrait look and here on the save image I will add a prefix called portrait and this will allow me to later on on the output see all the files that will generate let's click the extra options and do a batch of five and the reason I'm doing a b of five is because I have five options here in my prompt so each time it runs a prompt it will use the respective word from this generation let's click the Q prompt and see what happens so now you can see here in the text that it created a portrait photo of a beautiful cat and you can see here that we have a beautiful cat and now on the next run it generated a build a portrait photo of a dog so it change it automatically to a dog and then a bird and a mouse and a shark it is done running everything and you can see it here on this output panel you can see that we have all the images I don't really like using this panel I think it takes too much space so I'm just going click the X and we will open the output folder and here besides the 10 cats that we did on the previous technique you can see that we have five images that were generated based on this Dynamic prone so we have have the beautiful cat which is indeed beautiful if you ask me we have this beautiful dog this bird the mouse and finally the shark so I guess you can see how powerful this thing can be but what happens if you have a list of for example 50 words and you don't really want to type this entire prompt what you can do quite easily is use a template file now in order to use a template file we will simply pull open a notepad or any text editor and we will create a file where each prompt or each word that we want to be changed is separated by a new line so in this example we will do a horse and let's do a rhino let's do um a snake a snail a rat fish spider worm tiger and a lamb now we have 10 animals we're going to save the file and in order to use it we need to save it into the comy y custom node section so we'll go to the confy Y Route confy y here you will have the custom nodes and here you will have the dynamic front here we can go to the wild cards and there we will simply save the file in a name preferably without using spaces or special characters I usually use lowcase English characters and that does the trick so we will call it animals and now the way to use it inside the prompt is very simple we'll go here and inide instead of doing the curly brackets we will do uncore underscore the name of the file and two underscores one more time so it looks like that do note that sometimes you have to reload the interface for it to load the file and we can do a test to see if it cut the file we will just remove the extra options and click Q prompt once and you will see here that it actually managed to load the file but it recognized the word fish and if we look into the file we see that the first word is horse well the thing is that Dynamic prompts when it loads a file it uses the words or the wild cards in the alphabet order meaning that it will sort the words from A to Z and this will be the order of the words every time you click the cute PR and every time you reset the file what I usually do I open it up in Excel or something similar to or Google sheet or something like that and I simply sort the words and that way I can really know which word will come first but for our example it doesn't really matter let it just run and see if we have all the animals that we wanted now note that I clicked the CU prompt once and it did the fish if I click Cube prompt once again it will change it into the horse and I had a total of 10 animals so I will simply add a batch count eight in order for it to finish the entire cycle and we will click Q prom the thing that will happen if I will click Q prom once again it will start from scratch and it will do the loop and start with the fish once more done running let's open up the output folder and see what we got and you can see that after the shark that we last had we have the fish the horse the lamb the rat there right now uros the snail the snake I really like the snake photo the spider the tiger and the warm which is kind of a weird warm but nevertheless It is warmish Well I got to say that I really like these images I really like the result of these images and I hope you understand what a useful tool this Dynamic proms can be and another way something that I usually do I do something like that I will open up up Gemini and we will ask Gemini to generate tail prompts for a text to image models make them one paragraph each make them concise and and let let's see what Gemini will generate and you can see that it generated 10 prompts that I can simply copy and instead of running them one by one by one I can just create a file this time and put all these prompts in this file and I will simply save the file let's call it um gini for example and click the save and now if I'll go back to the confy UI in here instead of typing anything in the prompt I will simply delete the entire prompt and simply put the file name itself once again with a double underscore before and after the file's name and now if I'll click the Q prompt with a batch of 10 because we have 10 rows each time it will generate it doesn't work okay so if you see that it doesn't work it means that it didn't manage to load the file correctly we will simply clear the queue and cancel the run and usually you can either restart the interface or sometimes even just refresh the page let's see if it was able to do it okay so it didn't so what we're going to do is simply restart the interface and we can do it simply by going to the command line here and click contrl C several times Until It Breaks the code and once it is done we will simply run the confy UI once again do note that it reloads everything but it will save the last position or the last state that your uh interface was in and here we will now click the extra options once again we will do a 10 and click the Q prompt and you can see this time that it managed to load the correct prompts from the gmany file that we just created let's let it run and see that result the results that we just got once it is done running let's go to our output folder and see what we got and you can see that we got 10 beautiful images I accidentally left it with a prefixed portrait but it doesn't really matter and you see that we got 10 beautiful images just like that very fast and if we like something we can simply take it and continue working on it from there and once again if there is something that you really liked and you want to see you can go to the view history here and click the load and it will automatically load the entire flow that you were just running running and you can continue using it from there the last note that I want to show you in this video is a custom node called save extended and once again we will go to the manager and here we will click the install custom node and we will type save and search and here down you will find the save image extended for comfy why this allows you to have some additional features or additional settings when it comes to saving images so once again let's just click the install let install it for a few moments and we'll be back once it is done and once it is done uh reloading we can simply double click and type save image and you'll see here the custom note called save image extended and you can see it gives you a lot of information that you can keep with your file name and we'll simply drag the image through here and let's give it a run do note that you can actually create subfolders here you can save the file into a specific folders so let's call it Gemini for example let's once again click the Q prompt and see what happens once it is done running and in the output folder this time it created a folder with the name of the model because you can see here that it is set to save the ckpt which is the checkpoint file name into a sub folder so here you will have the Gemini which is the custom name that we gave and inside it we will have the name of the file that was just generated and it is all also set to save the sampler name the schedular CFG and the steps so if we look at the name of the image you will see that you have all this information directly on the image file name it is very good to use this extended mode especially if you run something like 100 prompts in a template file and you want to have a folder with 10 prompts and things like that and the way to do once again let's say that I have a file with 50 names you can actually use the combinatorial prompt also with these with these fields it works the same I can simply right click and here I can convert the folder name prefix for example to input and instead of typing it manually I can take it from The combinatorial Prompt I can actually create another file that holds the names of the folders that I want to generate and so on there are tons of options not going to go over with you on all of them because it's quite endless but I really hope you liked all those custom nodes that we used here so that's about it I really hope you like these techniques or custom noes that I've just shown you uh I'm going to do several videos like that that introduce several Concepts or techniques or me methods that can really help using comfyi in a more managed way or a more U flexible and dynamic way if you like the video please subscribe and like and I will see you on the next video bye
Info
Channel: The AI Art
Views: 1,990
Rating: undefined out of 5
Keywords: ComfyUI, Interface, Tutorial, Training, controlnet
Id: HLTNRSHRoyU
Channel Id: undefined
Length: 24min 21sec (1461 seconds)
Published: Wed May 15 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.