ComfyUI Infinite Upscale - Add details as you upscale your images using the iterative upscale node

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right I'm going to show you a really cool upscaling workflow here and it's going to have some other tips and tricks in here so even if you've seen me build a graph before I think you're going to learn something here I think this is a really great build and it requires a node package called the impact pack so if you go into your manager here under install custom nodes you'll see it right here now if you don't want to use the manager or you don't have the manager that is available over on GitHub as well right here and if you want it you can just go code copy and then I mistakenly said this the last video you'll use git clone not git Fetch and you just do that in the custom modes directory of comfy and it will install it for you and once you've got that installed we can get down to making a graph again you've seen me do this before you're going to learn something because there's a few tricks in here that I haven't seen anybody else talk about so I think you're going to find these entertaining first of all we're going to use a different model today we're going to use an anime model one of the waifu models I know you're thinking there's wafu models uh we're like yes there are there's a couple and we're going to use one called soap mix and I'm going to use it only because it allows me to demonstrate this in a very easy way and I thought that this kind of was helpful so go ahead and load it checkpoint so we're going to add node go to loaders and load checkpoint and go ahead and pick your model of choice here we go and now this model is a not safe for work model but of course we're not going to be prompting it that way so just be aware that some of these models wafu obviously it's a kind of a fake Japanese word I should give you an idea uh it's producing some very playful images but be careful there all right so a couple of things here they're going to be very interesting we're going to use a thing called a pipe and it's one of the things that comes with the impact pack and it's probably let's say one of the two most important parts of the impact pack for me to use it uh you just will go to add node impact pack pipe and then you can see there's a whole bunch of different ones we want the two basic pipe and what that allows you to do is basically take all of this stuff here that you'd normally be dragging around and output it as a single line which is pretty cool so let's go ahead and do that let's go ahead and hook these up and then we're going to go ahead and do our real quick prompt so we'll bring our clip down here and we'll enter a text encoder this will be our positive so we'll color out this one green and then we'll introduce one more here and if again if you hold down your shift key when you paste it will keep all the connections in place for you so we'll just go ahead and make that one red I used to have some texture we'll plop in place here photo of a woman with a light blue hair uh let's do a pink T-shirt with a print with print let's do floral print by the way if you can spell if you want to in here this is kind of fun if you put the curly braces first the curly brackets do pink blue red and then close curly braces you'll find that you can get a variable in here that will randomly pick one of those three options or more and you can do this in numerous places so you could say jean shorts or skirt or dress or what have you and make this all happen I warn you though that if you do this every single time you run a queue as you would expect it's going to come all the way back and reevaluate this if you're trying to troubleshoot a workflow and you don't want to continue to rebuild the the latents every single time then don't do this so we're going to kind of skip it but I did want to show you you can do that here which is pretty cool so let's go ahead and grab our pipe bring it over a little bit further and we'll put our positive in place and our negative placing and we'll put a cartoon down here because that's what I think is a negative prompt for this shopping at uh Walmart yeah shopping at Walmart you have to probably give it some interesting background is what I'm hoping for there so that's it now we have this big pipe and we can do all kinds of crazy stuff with it so what do we do okay so what I'm going to do is I want to I'm going to put this into a case sampler right away we want to go ahead and start our process so let's go ahead and search for k sampler but you'll notice that we want one that has a pipe so we'll see here impact case sampler basic pipe so if we look at that now we have one that just takes one line and that's it so now we can leave all this other stuff around and we can go into another place and be working on our graph and only have one line leading down that's it so we do want a latent image here so let's go ahead and grab a latent image so delatent now another little cool trick that a lot of people don't know if you're trying to do math in here and you're like well okay I need these divided by 64 but I'm not really sure what the next iteration would be you can actually just do it here so you need 64 times 19 for example and I'll go ahead and do the math so if you're trying to figure out what that is and you're you're busting your brain trying to do some math or you're writing numbers down you can actually just do it right in here so that's kind of Handy and I'm going to go ahead and set these to go ahead and change these to fixed here and just use a seed of one just so that it doesn't again redo this one every single time okay now we don't necessarily need to use the pipe that comes out of this right away but we do want to actually do our standard operation here which is to decode it and see what we made up here speaking of bae um the vae that comes with this checkpoint is not very good so let's just go ahead and add one so we'll add a node a loader head of eae and we'll pick um let's just grab the standard version here of this one and plug it into the pipe and that's really nice because we just plug it in up here and it carries it through the rest of the process and basically done so we can go ahead and preview this image we'll put it up here somewhere and I think that looks pretty good nice simple graph and again if we save this off we can load this out every time and start from here there we go it doesn't look like Walmart to me but we'll we'll run with it she's shopping at least we got points for that I do want this to be a little bit higher quality so I'm going to go ahead and change my sampler to one that I prefer CFG I prefer closer to six and a half just personally and I want my step count to be much higher also 40 which is pretty pretty aggressive and again we do want to keep the denoise at one because we're starting with an empty latent and we want to obviously denoise the whole thing so let's do this again okay that looks good all right and don't worry if it's not amazing it's that's not really the goal here you'll see as we as we continue onward it'll get much better okay so now we want to upscale this and you can see that we're at our maximum size here which is the one that we we asked for this 304 by 512 and I want to go up bigger than that and I can do that right from here again one of the other things the impact are these upscalers so if we go right click add node act under upscale you see we have all kinds of them in here but what I'm looking for right here is the iterative upscale latent and this is super powerful um I just really think this is one of the greatest nodes in here so far that has a specific let's say General use and what it's going to do is basically we pick our upscale Factor let's just use two as an example and what it's going to do is it's going to go from 100 to 200 but it's not going to do it in a single jump it's going to do it over the course of three jumps so it's it's the equivalent of basically baking three of these together and going step to step to step which obviously is a whole lot of noodles laying around so this is really cool so we can get to 200 percent and we can do it say we want to we want to do it intense we're going to do you know 110 upscale and then 120 upscale based on that result and so on and so forth now 10 steps is a bit much and I'm actually going to stick with the 150 for this demo I think that's plenty right so what are these other things here and that's uh obviously no the latent's going to come out here and we're just going to decode it and make an image so that part's not super exciting as this part is actually very cool so the upscaler part here we need to give it a provider and this is one of those strange things in comfy is we normally see kind of the the noodles the process follows the noodle like we don't ever go backward in this case we will it's gonna it's called a provider so anytime you see a provider that means that it's actually going to be processed every single time we iterate so if we pull this out here you'll see it'll pop it out and we have one called pixel K sampler uh case sample upscaler provider pipe well these are getting long words here and you can see it takes the basic pipe just like we have up here so we can go and grab that actually we can grab it from here too because it just comes out the other side of this one so it doesn't it isn't as long of a trip or you can just drag it on from Top it doesn't matter but it's nice that it's provided through through some of these controllers for example this one does not have the pipe on it I mean there are some options here this one is an upscale model optional so if you have your favorite upscaler like you prefer one of the ultra sharps or you have one that adds skin textures or something like that you can feel free to use that here if you would like I'm not going to use one because there is one built into this a provider and it is I think it two times and it works very quickly so I'm just going to go ahead and use the ones in there since I really don't care I am going to up my steps though to say 30 just because I want a little bit better result here and what would be ideal is because I'm going to take three different steps to get to 150 is if I could start with say a pretty aggressive noise and then get smaller and smaller with my denoise value as I go and obviously one is too much but I could start with say like 30 but by the time I'm done I'd like to be barely denoising it can I do that and you can that's what this hook optional is here so if we pull this out there's two versions of here there's a CFG scheduler and a denoise schedule so start with this one first and you can see that now I'm going to use the word Target is the way to remember this this is what we want to get to so say we're going to get to a point one which is obviously barely changing anything and we started at 0.3 that means as we go over each one of these iterations we approach this value so that's pretty simple and there are another options for schedule for iteration is such a simple and there aren't anymore so we'll leave that and if we drag this out well then here we drag this out now we get to CFG schedule and this is the same thing we have a Target CFG so if we put this higher let's say 13 for example we really don't want the image wandering around we want it strict to The Prompt but we want that to happen near the end of these iterations but at the beginning maybe maybe six and a half is fine uh well I want both of these things and if you see when I hook one up the other one is dropped there's actually a great little addition here if we pull this out and it's called The Hook combined pixel case sample hook combined that allows you to bring in both of these things so we can have both a CFG and a noise now these are optional obviously so if you don't want to use these don't have to but I think this is pretty good so I'm going to go ahead and change my sampler here as well just to maintain consistency I'm going to change this to fixed again I'm going to change it to a different C than the one up here if you use the same seed over and over again I tend to think that things get a little bit contrasty and it may just be my imagination but I'm going to go with it and I'm going to change the color of all of these just because they're standing together to something so I kind of see there together and we'll do this one here too these are all the same kind of step in the process let's just change the color here so we can kind of see what we're doing all right I'll go ahead and decode this one code here we need our vae again and we're going to need this all the time it's one of those things we're going to be dragging around with us so I may want to do is just drag it from up top here and keep it handy um let's just do it from here I guess bring it down here and we'll create a reroute node which allows us to hook it to a bunch of stuff we're going to use it a lot down here so I'm just going to have it handy so reroute by the way has two modes you can do it this way or you can change it to Vertical which in this case might be more interesting if we were working our way down but I'm not going to do it that way because I'm used to seeing it this way so let's just do that and then we need a preview here put that somewhere up here so it's kind of a similar thing and we'll change its color as well so we kind of keep track of what's doing what make sure everybody is hooked up here again we're not using this model an upscale model you could if you'd like but again I don't care too at this point so again just to kind of cover what we're doing real quick it's just going to iterate through three times each time going to this provider and asking it what are the settings I'm supposed to be using and it's going to be again using these schedules here for the denoiser and the CFG every time we iterate because we have it set to fixed we don't have to go all the way back to this node now we just continue onward you can see here it's showing you the number of steps and then the amount we have scaled it up through each time and there we go I guess this one should probably be light blue as well all right now let's uh let's show you one other little trick here that I think is pretty interesting and if you don't like the detail here you think we lost some stuff obviously go ahead and play with the noise and and so on for all these settings you can even just sever this and see if you prefer that better this just this operation is what I want you to kind of get used to seeing and again play with the settings to do what you want to do I'm just showing you how it works right okay so let's do one more but we're going to do kind of a weird a weird little thing here we're going to do it kind of an image to image at this point instead of using this a latent we're going to do the same thing but I think the latent later in the game gets a little weird so a little unpredictable isn't a good thing usually so let's do it just a different method here and so we're gonna do an iterative upscale so we're going to add node impact okay we're going to go to the upscale I'm going to grab the image one so the image one is asking for image obviously so let's just feed that right in here so we're going to continue with this whatever this image was here we'll just be pumped into here and again our upscale Factor we'll just leave this the same and I want to show you a cute little trick here so I'm saying this is going to upscale this for image to image but I want to show you one other interesting part of this because this is obviously it's almost the exact same thing in fact we can use the exact same upscaler here and we can use the same ve and we'd be done I mean that's that's really that simple but let's uh let's complicate things a little bit here because I think there's a cool toy or methodology I should say I can bring this this pipe that came down here can bring it down again and here I can go from a basic pipe so basically it turns it back into all the individual connectors I want to show you something you can do with the prompt that's pretty cool so we're going to actually concatenate additional words onto the prompt for this last upscale step which is I think kind of cool so we have to go through basically the same process we did before where we're going to sample everything but we don't want to use the pipe version of this okay so what I want to do here is I want to take these and we're going to type in pixel this is a different upscaler here we can see that there's a pixel sample upscaler and then a pipe version so we're going to use this version here and again it offers the upscaler so we're going to do a model AE negative and if we want to use these same hooks options here we can go ahead and hook those up and again if you want to use your own model you can as well and you may get better results but again I don't mind the one that's in here but I mean I can show you how to do that real quick you just drag it out choose whatever upscale model you want here we'll use swin which is the default and you're done I mean it's that simple but what I want to do here is I want to insert or concatenate two prompts together so let's just go ahead and grab this prompt box up here and just hold down my ALT key when I grab that by the way and it'll duplicate it you'll have to right click and choose clone or any of that and we're going to put something in here let's uh what color hair does she have she is blue hair let's go with purple purple hair another little trick here too is if you highlight something and you hold down control and up Arrow you can increase or decrease its weight this is the same thing as automatic 11 11 in case you didn't know that also works that way so I have this but I want to put it in there how do I do it if you drag this positive out it'll suggest it to you so we have concat and combine so I'm just going to grab combine because I really don't care about the ordering in this specific instance so we'll put our positive in here and we'll put our mission in here and we will need to connect the clip to this side so we have and this wonky wonky thing going on here there's my OCD just triggering we don't actually have to leave that one expanded because it doesn't have any options there we go that's better ish well up our count here just like 40 or something like that be consistent with with our Samplers you don't need to be but again if you get a surprise and you wonder why it's probably happening somewhere in that area we'll use a 2 here we'll set this to fixed and then again we have our upscaler we're just going to pass it right in here a again because maybe using that and then again out the other side will pop um our preview well I actually use a save this time so we can save it to our hard drive and they should be similar in fact if we use the same noise as this one here uh which we are by dumb luck then we'll have hopefully a very similar image now we did change obviously the the size of the tokens that we're sending over so we may get a different image but hopefully it will be what we want it to be or at least remotely close and again we could color all these for consistency sake which I'll do super fast just to be if I want to save this and use it again and again and again then this way they all kind of have the same thing going on and I don't always have to correct myself when I start it only takes a second to do it the right way and we see it's changed quite a bit there I bet we did get our wish we got some purple hair out of it so we could probably look at the denoising here and sure enough that's a part of the problem although it started at one it obviously got all the way down to the Target here of 0.1 but it did have a chance to really kind of do some damage to the image so if we start at 0.3 here like the other one they should end up closer together and there we go so a really kind of a nice option to go back and modify the image slightly you won't expect any gigantic changes here but that's pretty cool obviously we can increment our seed here and get a completely different image if we go all the way back to the very first case sampler here and then obviously these noises will obviously influence what's happening through the rest of the model but whatever happens at the end here purple hair is going to be added to the model for this last one but there you go pretty simple graph using again the pipe I can walk through it very quickly again but use the basic two pipe and bring it down to your your Samplers again there are piped versions of Samplers and then there are the non-pipe the normal ones and then when you're using these iterative upscalers that's the number of iterations it will take to get to this scale factor and on each iteration it will use the pipe provider and then again you have some hook options here if you want those otherwise those are optional and again the model if you have a custom model you want to use gonna hook that up as well and you can use it in multiple locations like like this and you can take the pipe and tear it apart if you need to get to the little in itty bitty parts inside of it there like we did here where we concatenated in another prompt that means the combination for the conditioning here so we can kind of bring everything together and then we did the same thing again we went through another iterator with another provider we could use the exact same provider but I did want to show this concatenation here so we did use another one but we can certainly use the same one over and over again but anyway there you go that's an upscale option for you they're obviously a great many different upscale nodes available but I love this iterative one I think it solves the problem of trying to LEAP too quickly into a large scale instead of taking an iteration or getting there slowly so a big fan of this one everybody take care stay safe and I'll catch you all next time
Info
Channel: Scott Detweiler
Views: 23,159
Rating: undefined out of 5
Keywords: midjourney alternative, sdxl, stable difussion, ai art, comfyUI, automatic1111 alternative, stable diffusion, stable diffusion tutorial, comfyui tutorial, sdxl workflow, stable diffusion sdxl, img2img, image 2 image
Id: t3lT_04A9j0
Channel Id: undefined
Length: 21min 5sec (1265 seconds)
Published: Wed Aug 09 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.