Creative Use of ComfyUI - Auto Face Upscaler Workflow Discord Class with PixelWorld_AI

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay so uh today's class if you will I don't even know if we'll be able to call it that but creative use of comfy UI um now some of the things I've heard from a lot of people going from a11 to comfy is like lack of control um or I guess lack of creativity or creative input um and that's and I'll and you know unpopular opinion I'll kind of agree to a certain point there too um because if you're if you're wanting to impaint every little aspect of your picture um image to image several times over try different seeds out for that image to image you're probably going to be better off in a11 um I don't think that's super disputed maybe some people have some workflows in comfy that work really well for that but I haven't really seen any uh and I've I've tried in painting once and I almost threw myself out the window it was it was not that great of an experience here yeah yeah and and here's the deal now let me finish um now with that being said I think it flexes different creative muscles at least for me um for me and and I'm a little weird for me art has always been kind of like a uh a problem that needs to be solved and the satisfaction you get when the art is finished is you solved the problem and that's why I like AI art so much um some people have a different view of Art and the whole process and you know that's all great um because I I kind of get that way too um but with comfy you get to go in full Problem Solver mode while getting a cool picture out of it and that's kind of why I like comfy a whole lot more than automatic um so I I've a lot of the problem solving is is creativity and how I'm achieving that is finding new new problems to solve constantly um I used to what we're going to be going over today uh just to give an idea is I have this automatic face in painter if you're not if you're not like super picky on how the face turns out in like a automatic in paint then this is kind of a cool thing to do because the way I have it set up at least is most of the time the face is the best part of the picture everything else can be trash if it's going to be a bad picture of the face is usually not the problem so it's worked out real well for me so I'm going to show you guys how to build it um and then let me go over a couple of other things so this will require uh the was node Suite uh good old wazzy woz if you haven't gotten it f uh there's those links in the classes Channel um as well as so link to the GitHub for was node suite and then the uh the node manager I haven't got that myself but I really need to because I need to install more nodes but I'll put those in the YouTube video as well if anybody's watching this later um so let's go ahead and get started now I'm going to be uh I'm not I'm not going to be pulling up the side menu and doing this I'm going to tell you what to search because I don't even know where I find some of these nodes I just double click and search them so we're going to be doing that today uh so let's start off here's here's my setup here uh just kind of the similar thing to what we looked at last time and what you know most the basic start of a 768 upscale to 1024 that's kind of what I usually work with I actually have Bard's model in here um really good stuff can't wait for it to be released um I'm sure it'll post it on his Mastodon too um as soon as it's published so um so yeah just a 768 upscale 1.333 uh and that's going to be 10 24. and then that's upscaled to a 2048 by 2048. um and I'll tell you why in a minute but first uh as far as finding the face automatically that was something that I was always struggling with with the was node Suite look up it's called clip sag masking so this will let you will let you basically select a mask area by a prompt so for this case I'm going to go face um that's and this is the first of a lot of nodes we're about to introduce here but this will basically use clip to detect the face and ends what I want to try later is we'll probably try bread or hat anything like that see if it in paints or masks that area well enough too because it's it's really cool it detects the closest face or if it's got noticeable faces in the mid background it'll just widen the scope of the uh of the Mask which is really cool so I could basically just have this running and if if an auto prompt spits out a group a group of people it'll just upscale basically that entire group um so you have your clip sag masking um now what it's going to do there's been I'm looking at my uh I'm looking at my current workflow I have image to contrast mask because I think clip sag outputs The Mask funny let me do this um just to see mask to image I want to see what the mask spits out so you connect that up to the mask You're Gonna Go preview so I want to see what this thing spits out and I have this image set on a fixed seed so it's only going to spit out this which means I run that it's gonna Eclipse egg and there we go so it picked up the face there um so actually that looks exactly like what I need so I'm going to just bring this guy down here I'm gonna get rid of that and then I'm going to test something um no no I remember why I did it this way forget that we're gonna go image to contrast basically it's going to spit out um what I found is when I do just the regular mask it spits out the inverse of what I need and also the uh threshold being the ability to adjust the threshold to make it a little bit softer I'll give you the guys the exact settings here what's that Sonic for am I going too fast you can watch on YouTube and play it uh 0.5 speed so for the for the face I find that this is just my settings I'm just copying them because they've worked for the thousands of pictures oh okay I was like yeah um sorry if I'm going a little too fast yes my graphics card goes just a little a little Teensy fast um let's go and like I said it's going to do an invert that's not how you spell that invert mask and these might be I'm gonna mess with them a little bit later but for the sake of just showing you how this whole thing works I'm just going to keep that because I'm pretty sure I can fix this up to work a little differently um and then mask prop region so so let's talk about this so you saw that image that spit out it basically had the whole size of the picture but with a little white blob where his face should be now that's great um because that's what we wanted to do but the way that we're about to use this we want to zoom into just the face the uh masked area so we can only upscale that part because otherwise it's gonna at least the way I have it set up it's going to want you to just upscale the entire image if you feed in that mask so we're gonna go mask crop region connect that to our invert mask and this is where it gets a little so this um so this node looks like a whole lot there's a whole lot uh that can go out of this thing let's see show the results step by step uh how do you mean with the uh with the uh masking or the whole process oh yes uh so and I'll show you where I add those here in a bit because I like to have that mask show up and see what it's because it's cool because it'll it'll sometimes mask like the hair and everything and so you get to see how big that mask and mask ended up being I also I just like more things popping up on my pipeline because it looks cooler I think that's the most important thing you gotta worry about is making sure it looks cool and there's a lot going on otherwise you shouldn't be using comfy how to do watermarks mine is actually I could show I think I could show how to do that in a little bit after this part but I do all my watermarks in here because I don't do any uh editing in Photoshop anymore because uh sdxl took all the fun away from it and so um but if you're interested in doing some easy like just a ton of portraits where you know your model is going to be great I can show you a way to do a mask sorry image blend of a watermark it's been really cool for me so we're going to want to crop this to the minority region the smaller part of the picture um and I have mine set to 15 it hasn't failed me yet Nan see here this is where I see some of the uh progress so uh after it's uh cropped the region I want to convert mass singular Bert ask to image yes I hate it when it's not named the right thing then we're gonna go get a preview now we're gonna see it figured out the face just fine and zoomed right into it oh man that's like one of my favorite Parts there yes I can tell that's a face it's amazing so um now it's gonna need to now it cropped into this mask just fine that's great um now that we cropped into it it has no idea where the where the mask belongs for all it knows the mask could come from the very middle or it could be the entire picture because it's a square um so it has no idea so we need to um we need to crop the image uh the original image that this came from well at least mine uh yeah no with the uh with the clip sag so far I've only ever seen it do a square I I don't think there's been a single time I've seen it do anything but a square so it won't that's at least one constant is you don't have to worry about your getting a wide screen of a face yeah absolutely probably not for like guns if you're trying to do a gun like a rifle um it'll it'll want to get the entire thing too so we're going to crop into the image using image prop oh see yeah there's a face one don't ever touch that it's awful seems like it's made for this but it's not uh image crop location so now I can hook this up to my output right here but how is it going to know where to crop into um so if you haven't messed around with enough uh comfy yet you probably haven't right clicked on it and converted top to input we're going to convert left to input right and bottom what this does is instead of having it be a number input it's a you could string it right on over to other nodes and I'm not super yep you can you can see hard-coded value from the big brain engineer I only know how to Tinker and this is what I've tinkered with and what I've figured out so I'm going to connect all of the corresponding parts of her sides of the image right on over here so now and I'll do this again is that I will also have this in my final setup cropped into the face that's not perfect and it's not Center but dang does it not matter at all as long as the eyes because later on we're going to blend it back in as long as the eyes don't end up like up here you're pretty much good if like the eyes are like right here uh you don't really want the mouth to be upscaled all the time depending on the size of the image um so anyway really cool so now we have that zoomed in what are we gonna do with it well we gotta upskill it now this is where we talk about some of the weirdness about the setup I usually do um at the end of the generation I will do the upscale with the model uh if you're more familiar with automatic 11 11 that's going to be your extras upscale uh basically a two times upscale of the 1024 image to this the reason why I do that is because I want a bigger image of just the face uh as in higher pixels higher amount of pixels and just in the face um everything else like it does well enough with detail as long as it's not super intricate with the face goodness gracious it does not look great so you increase that size and now it's going to first I'm going to go ahead and get a vae n code throw that in there that efficient case sampler lifesaver um I'm going to bring the pixels on over there and then going to do all this hoopla I'm going to connect a case sampler to it so it can resample the picture at the resolution that it was kind of extras upscaled to where it didn't add any detail but it just made the picture like actually bigger yes if you're going to use the efficient nodes um I'm going to go ahead and put a link to that the efficient I think the efficient came with me came with what I have though that's the strange thing either I never installed it is it is it something that's supposed to be on its own because I've never installed then I don't know what I installed um but yeah we'll go ahead and throw a link to the repo for the efficient node because it's nice I don't think I installed it but okay I'm wondering if uh was nodes you linked it anywho so now we're gonna get that image that cropped image upscaled using a k sampler that's good and we'll talk about um talk about denoise because that'll kind of depend on the model you're using along with uh the size of the image you're going with and a lot of times too you're going to want to find kind of a good middle ground because if the face is closer to the image or closer to the viewer you're going to probably want the denoise to be lower because if you've ever upscaled and upscaled and upscaled just a portrait of a face it starts getting real weird real fast so we're gonna go via e decode depending on your GPU you may want to have this a tiled node so in case it it ends up being ginormous you don't have to wait for the vaed code to switch to tiled because I've had that apparently I had that sitting around for a while and every time there was a portrait it would take forever to decode so now I want to see how the face looks after the upscale do that looks awful but I think I could probably try another scene this is where having your K Samplers fixed comes into play if you're wanting to Tinker with it a lot this looks a little bit better it's like every time an anime generation of Steve Buscemi comes out it just looks like this but you see the quality difference in the face and also the ears and the bread and the chin and everything around it because it's up sampling the entire picture so um see what's next so now um we're gonna have to paste it I'm gonna start scooting some stuff up it's getting a little crowded in here so um let's see where do I go from here okay so image paste by location we'll use very similarly um the values from the crop just uh just like that on this one image it's paste crop by location just wanted to make sure and then let's see we're going to do the same thing so we're going to take all of those input values to the top left right bottom and now where is it the crop region we can just grab those values again so top right there left right bottom now I just gotta this is where it gets a little bit fun because now I gotta remember okay so the crop image is going to be the one you just up sampled and then the original you're going to hook up to image and then there's two let's let's do this because I've not messed with this yes yet there's a uh two image outputs I want to see what the second one does because I've never used it this is the fun part okay so it'll show the mask and its location uh this is where I pasted it rather so that's cool and now it pasted that back into the original image it's amazing he's got the best two jobs ever at once so blending I usually have set to three but as you could tell it worked out perfectly well on this one um what you don't want is if your denoise is too high you're going to get um image switch Yeah I mean if you want to mess around with the other notes I honestly These are nice having up here but after a certain point of just thousands you get to the point where you're like oh yeah I trust it um and you'll find those values um in specific values for your nodes you'll be like yeah I can just leave this for a minute and it'll be fine what's the node called again image image Stitch oh get out of here very nice that's cool hooked up to the original yeah we can do that I think that's the case let's see why you know okay so I was wrong that's going to be this one so before come on after and that's how you make a really simple super easy face up skill now does this take the fun out of it I certainly had a blast and I felt when I when I figured this out for the first time I felt mad creative I felt like man this is the most work I've put into because I mean I can the prompting's all fun but this is where I have a whole lot of my fun is connecting spaghetti from one node to the next yes of course let me go ahead and Scoot some stuff around and then we're gonna go random and then what I do a lot of times is I have the uh I have the Q next uh check box on because I'm going to get rid of that because it's going to do ooh I'm going to do a bunch and if I don't like how one's going I'll just hit cancel and I'll load the next one let's see what it does to the face oh beautiful eyes very good this man's a happy Baker he looked so much more sad on this one Bard's model is absolutely awesome apparently it's a mix of well I'm not gonna give away the secret recipe but it's a mix of a lot of very familiar models so yeah let's uh I'm gonna do something fun too we're going to change it up we're going to go a little wild there we go [Laughter] that's great it's wonderful um anybody have any questions anything like that there's always something to add um I do know um because brain you've been doing the face up scale a different way right yeah um so um I might be looking into that as well because I want to see if it's going to be as reliable as this eventually um but I haven't heard enough about it and I've trusted this one for so long and through so many pictures that I'm like you know what this is one less thing I I gotta worry about um oh you know what we were going to do I want to see if that uh and detect bread yeah so let's see if it detects the bread okay so since the entire picture is bred yep so it masks all the bread it could find well now we're just going to upscale the entire picture if I was on my old graphics card my computer would have said no by now okay wanna try how about this let's get tricky how about his badge if he has one that'll be a really small thing to hone in on okay so he's got a badge nope it did not want to do the badge we're going to try one more and you know what maybe we can we can cheat a little bit wearing a large uh just say badge so yeah it's gonna be a bigger badge oh that's just a name normal sized badge oh I should but also hey there we go [Laughter] we're talking about about how close the image gets um yeah that's that's one nice badge look at that uh yeah no I put I put approximately 20 seconds into the prompt and that was also adding the clip encode nodes I mean it could but most of the time when it can detect a face and once it crops in and can still tell it's a face it has no problem saying okay this part of the picture is probably Anthony Hopkins but since it it could barely make out that it's a badge it's looking at that and going hmm that could be just Anthony Hopkins holding bread it's just a really bad drawing of it and so that's why you kind of end up like that sometimes it'll do the same thing with the face if for some reason it has no idea what this is it'll be like I mean I've seen faces before that's not a face so I'm gonna do one more with the badge it's gonna do the same thing I'm pretty sure no badge let's try that again great picture though okay good badge and we'll talk about some of the stuff you're not gonna or you might run into so yeah it didn't it got the face and the badge but oh well so um see here you can't do uh batch sizes of two or more it's got to be one because once it gets around to lip sag it's going to be like oh oh slow down we can only do one picture at once it's not going to create two masks and then do that whole process because it can't so let's give that a minute and done so not gonna do that just so you guys are aware trying to think if there's anything fancy to be aware of with this it's a cool setup and you can do with a lot of different things if you're uh what's that yes I do this exact process in sdxl and that's been the awesome thing is it's way better with sdxl because the images are already kind of clear by the time they make it to the uh face up scaler um and so the upscaler really just takes it that extra like that extra mile with the detail in the eyes otherwise the face like the nose and the mouth they look fine um because SD Excel does really well with most of the rest of the details so is that your name is censored in my streamer friendly Discord right now is that uh spaghetti sub spaghetti yeah you got here just in time uh we're about done so um anything else we want to kind of mess around with do you have any more questions about this or any ideas that could help make it a little bit better anything that frustrates you about this don't worry I can take it all right Coolio all right well uh I'll have the video uploaded probably tomorrow um and I'll get all those links in there be in the description definitely check out the wazzy woz nodes um it's good stuff if you like automation if you're cool I could share the Jason I could just probably pop this image into a chat here real quick too there you guys go drop that into comfy and you're good to go of course you'll need it'll let you know what nodes you still need if you're missing them alrighty well I think we're all good here thank you guys for coming um hope this helped out a little bit or uh gave you some cool ideas all right bye
Info
Channel: AIpub Academy
Views: 5,329
Rating: undefined out of 5
Keywords:
Id: qkKpx2FVY9M
Channel Id: undefined
Length: 32min 23sec (1943 seconds)
Published: Mon Sep 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.