ComfyUI Artist Inpainting Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay hello and welcome to another company UI tutorial um while I'm calling it a tutorial uh I'm more teaching you a certain way of using um conf UI rather than a specific process I'm I'm going to teach you kind of like a set of kind of things you can do and and the ways you can set and view up in order to get certain things done um the things you're getting done are not your typical come for UI setups normally it's you click go and it makes a whole advanced process and there's you know automatic stuff and you just you don't have to do anything you just click go um however that's not generally how like a lot of us make stuff a lot of artists will make stuff over time they'll come back they'll do rerun the same image again and again they might use external editors um masking all kinds of stuff and um because of that these things are generally these the workflows these are generally like a bespoke thing it's like a one-off thing and come for you I can do these things but it's not built specifically for that which means that um you kind of have to find muddle your own way through and find something that works each time you want to make an image so what I'm going to do is just show you kind of some of the practices you can basically put use put into use and in order to do that I'm going to do a long video um it's going to probably I'm just going to build a workflow from scratch to do a thing and um in the process I want to explain some of the things I do and we'll see if we come out with a better image at the end or a bad image um hopefully it's a better image than we start with and my cat has decided that it is time to become one with my lap I guess hello look down and add a kitty one okay um so in order that we need to build a workflow and yes you're going to sit on my keyboard um thank you very much so I'm going to be back in a moment having built a basic system and I'm going to include this basic system with the tutorial in the description um so bear with me [Music] [Music] thank you [Music] thank you [Music] foreign [Music] foreign [Music] [Music] thank you [Music] thank you foreign [Music] foreign [Music] I have now finished setting up the workflow turn this um so basically let's run through it shall we I may have shown you may have spelled version of me building this but I might as well show you anyway so we've got a resolution thing right here which is where we Define the resolution of this starting image which is 640x360 and that's because we are running a um at 1.5 based model which means it's better at low resolutions per initial image and we have a k sampler over here which we've used to produce the initial image it's currently not plugged in but normally it would be the first time you run this this is to get an initial image so we're running the K sample we're running it through a latent upscale to give it more detail and size because we don't really care what it looks like after the the first image which gives us the composition of the shot you can see there's a big difference between the two um but it's roughly the composition we wanted and It produced a dragon on a pile of gold however there are some problems there is gold up top instead of cave there's a mound of gold weirdly placed above it and um you know I have some concerns with the background here but I'm just going to go with it um I feel like it should just be in a cave but if you want to put the entrance in that's fine and these coins are ginormous for this dragon and we need to fix that too so in order to I'm going to unplug this because I don't want to run this every time this is just for generating an initial image um because I needed one uh you could you could just issue having this if you already have an image from another um another workflow or something um but uh yeah you could just put it in as well now I've added a laboriously I should say added a bus um which you may or may not use as options where you don't have to just run all the different lines you can use uh impact packs um pipe for that um I just want to be able to break it out wherever I need it um I've set up the prompts positive and negative with text and the initial prompt is what is it a photo of a dragon sitting on a mound of gold and I'm emphasizing the mound of gold in order to do that you can hold down control and just press up or down and it will change the value of the area that you have selected um which is good if it's having trouble making a thing in the prompt dramatic um adding the word fantasy creatures because this tends to help with dragons in a giant cave I put Dusty in there because I want some of the features you get with Dusty is the floor tends to have a bit more kind of a little bit of rubble and a bit of smoothness I guess to it uh Brown Rock because I don't want it just making random colors I want uh ancient Treasures because I don't just want there to be gold but um obviously it has necessarily worked that way um I've got filigree and gold which is where this stuff is coming from I think which is fine I'm just adding words to try and put trim treasure in basically and mounds of coins and chests obviously I've got some quality stuff here so I've got it's UHD 8K Ultra detailed by Caravaggio by Ridley Scott and these things you could swap them out and use whatever you want to um you know obviously I've told it to make a photo it's not making a photo um I don't have painting in negative or anything like that I don't I've got render in 3D because it tends to fix some issues with um certain situations but generally speaking it's just some basic it's a very basic negative prompt so um anyway um so we have created that image and I have saved this image out and uh it is in a folder on my desktop if I can find it here we go I've saved it out here as uh just by itself let's right click save from a preview um nothing fancy there and if we run a new uh now uh what we have is down here we have an area which is devoted to importing and working on the image refining the output essentially and um I've kind of pre-made a thing I'm going to redo it so you can watch so first off we've got a load image which I'm just going to set to load the normal one and I am going to only use the normal one over here because we can show the other stuff in a minute and I'm gonna unplug this I do not oh I can just use why don't we just use that eh oh no it may fail let's see all right control M to mute diminished it all right um yes so I can just run this in theory if it were Run please do not throw errors okay I'll just run this it'll go again yeah yeah yeah I just feel like 20 minutes making sorting this thing out so that I can show you how to do things so I have to kind of go back to where I was at before I actually made it all work okay um so in order to build a refining kind of section to your workflow You're Gonna Want to base it around a sample or a set of Samplers you'll probably want an upscale thing after this point um something to make your final image um it could be in line with this or you could just have it separate kind of like how I have this one separate and you just load an image um now if I just run this I could refine the thing a little bit just every time it'll come up with this on the next seed and just run it again it'll change it a little bit and you know it's not going to do much you could you could rerun the image like 20 times it like 0.5 and come up with semi-decent results but it's not it's not going to fix all your problems there's always going to be some underlying issue if you are just loading an image to run through this um but we can do better and we can do that by masking which is basically where most of the art from stale division is done um so you want to use you could use automated processes for this you could use manually painting it in right click on the this thing open the mask editor and do all that stuff um now all I could show you that process I've shown you that in another video um several other videos um so I'm not going to use that process here I'm going to use an external process in order to mask this um because an external process has some things that we can do that come for you I can't do currently and that's because come for your eyes masking editor is limited to say the least you can only change the size of the um of the area you want to mask you can't change its transparency you can't change its blurriness you can't change colors um it's not as fully featured as some uh and as a result an external editor is kind of a necessary step I'm going to close that and in order to mask and do stuff this and actually make use of masks you can see I've got a load image as mask here and we're going to make an image that works through this in order to do that we need is an external editor you could use Photoshop you could use this one which is called which is a free editing software package um uh I can't remember what the stands for um general image manipulation program or something like that um foreign anyway it's free came out on Linux originally um it's not exactly the same as Photoshop um there's but it has many uh it kind of has parody in a way it has the same kind of um tools available uh there's a few tutorials it's kind of it's not as commonly used but if you don't have licenses for things you don't have money you just want to get things done this is free and it is much better than paint you could do these things in paint too um but the advantage of using say or photoshop is you have access to layers which lets you do everything in one image so you don't have to save out multiple images well you do but you don't have to to work within those you can go back and edit them real really easily sir let's start by this is our original image and we want to change it so I'm going to delete these old layers that I made I'm going to add a new layer and I'm going to make sure that it is transparent on the background which gives us just invisible layer over the top of it now I'm going to add a second one because I'm now I'm going to need a second one and the top one um I am going to fill it with black and that's because um when you mask a thing it's it's generally it's a black and white image or a black and Grays images like a grayscale image and the level of white defines how like how much influence is being used so it's kind of like think of it as black being zero and white being 100 and this is the amount that this image says these areas need to be selected essentially for um SD or for you know other editing softwares or other programs it's it's a very common thing to use masking now if we have this as black it means everything will be transparent and nothing will be masked so we need to change that you could make another image with transparency into you know um but I'm just going to do this in the one image and I'm going to change the transparency of the top layer so I can see what's underneath it which lets me um relatively easily well that's a paint tool um change the eyes and start painting areas that I don't want I'm just going to change the some things about it feel that we are using brushed if you use the pencil tool it'll just have hard edges so if you want hard edges for things use a pencil tool paint will allow you to use the blurriness around the edges which is what I want I'm going to bring this up too and a little bit yeah that gives us a better brush to work with okay so the blurry edges around this are going to be less less selected than the areas which are pure white here we run no we can select the areas that we want to change and I would advise if you're doing this to only select one set of changes at a time if you want to fix the gold pile you don't select it at the same time you're trying to fix the roof of the cave trying to fix the dragon's face you don't fix it in the same process as you fix other sections of it and that's because it's easy to work on these bits individually than it is to try and get everything right in one go they're treated more of a step-by-step process with several passes than as a kind of um I can fix everything if I just mask out all the bad stuff in one go because that's not gonna work well you'd be very lucky if it worked okay so now we have this area selected I'm just going to make this yeah okay um so because the level of white changes the influence um it's gonna have a pretty hard Edge when we run this through second pass if you've ever used in painting um you know that often hard edges do occur and we can kind of fix that a little bit by changing the in this sentence it's force in Photoshop it would be opacity of the brush and we can blur it even more if we bring this way down we can create areas which are much less selected around the edges and this allows us to say I want this area to be changed less which gets rid of some of the hard Edge problem it introduces other problems of its own um especially when you're using things like duvet in painting and ah other other kind of setups that really you want to do this depending on how you intend to make use of the masking essentially so I've created this image and this is now black and white and if we run this 100 percent it's now a masked image so if we now can export this uh Photoshop you'll be doing save as in you want to use export as because then you can save out the PNG file instead of a random different file file type so we use Mask two and export now I've created the mask and we may as well go ahead and make another set of changes to this because if we run that mask just by itself it's not going to 100 work and I'll show you that in a minute but we may as well get set up for the next step and in order to do this I'm going to need to use the eyedropper tool and we'll use this to select an area from the background and this allows us to choose some of the color from this spot here and then we can paint over this gold which we don't want now I'm going to change the force up again okay now obviously if we just do the all one solid color um it's going to have some issues and that is it will give anything that you try to mask less detail and this is a an issue um that you have to overcome manually so you want to make sure that any area that you're painting in this way um has variations of color similar to the rest of the background now in Photoshop I would typically select this area and I would use the um generative fill type methods and then you just say okay I don't want to use any of this stuff I don't want and it will just heal thing over the thing and I don't necessarily know how or if um has that capability because I rarely use um but I will show you the cheap and nasty way in case you happen to have an editor which doesn't have access to all of the latest tricks anyway but if you have access to those you'll probably know how to use generative fill or ill-fill or whatever whatever it's called these days now I am going to use another color from the background probably a different one I mean it's averaging it okay kind of iffy all right and I'll make the brushes on the smallest one now the the thing that you are doing stuff to doesn't have to be massively detailed with this process and hopefully you can see the difference in those colors um I am basically just giving it some more pixels and and color types to make use of in the process of diffusing so it needs to have colors essentially in order to actually make use of uh this background in in the best way possible so that it emerges as much as possible with what we're doing and I might add I need a lighter color as well so let's use eyedropper again and try and get something yeah that's a little yeah that's a little bit kind of the same as well it's fine it's fine now if you do this process you may draw Outside the Lines just make sure you mask over any areas where you're going to have those those lines have gone over the edges or whatever um I'm just going to use the current setup I think and we'll export this out as an image server export as and I'm going to do two export all right so we have now created um what I would call as a um essentially we've created the seed or diffusion to work with and we've also created a mask so I'm just going to load up the load up the mask which was two and I'm going to now load the different image the modified image that we had and which is this one good okay you might be thinking oh we do it on that it's going to be bad but um not necessarily and I need to make sure that if I'm going to do any of these things I need to make sure this is passed through the um the van code with masking intact so we're going to use bitly mask now this method um can be iffy when using colors like this because it's better when it's used on something that is already a proper image behind it so it can have some limited kind of it's a little bit more limited in some ways than using van code for in painting or using other things and it has a tendency to want to return to the original image for one reason and that is because um we have still got the original um conditioning applied okay so you'll notice I've changed it I've influenced the background enough that it should make cave above it but clearly it is not doing that it may do it occasionally if I run this again and again and again it may do it but if we run like it with a second prompt instead I'm going to feed this second prompt over here which only affects the things run through this process and all I'm doing is I'm putting in this Mast area um positive prompt is Staff design influence just this master it doesn't influence the rest of the image it's just for this one part so if you run this it's not going to change anything but that one selected area so if I run this again hopefully I don't prove myself wrong with a bad generation but you know there you go it's not making terrible with me there clearly it fails to understand that we are in a cave not outside but that's fine that's fine and if you want to make sure that it doesn't necessarily do that you can use this negative prompting here as well and you can feed in the negative prompting over here and hopefully it will get rid of the sky if we're lucky I just want to do that the um over here there must be just a little bit too much blue in the background image there there's something here which says I'm this needs to be blue that's probably coming from the seed because this this is imparting noise through this and this kind of section of the noise that it's adding to this process probably has some um blue pixels or something in there which is helping it to feed that feeling there should be Sky there so even with this stuff and this stuff it can still go wrong um if I just tick this once to that seed it'll it could fix it it might have Sky elsewhere we'll see so as you can see the noise that's produced is not outputting this guy in this section now um so yeah just make sure that that if you're running these things remember that if you're using any kind of latent noise there's a chance that the stuff it creates from that is going to be um different colors you might expect and I could change that also by using certain levels of this if I get this to or three it's probably going to use more of the background changes I made which means it's going to make some kind of odd choices because this is not as detailed as the rest of the image so these are kind of blurry a little bit the color is kind of Muddy and so on let me go over here we see these are now out of focus this is kind of a weird Edge going on over here but yeah it can kind of work and certainly you could run this through once and then run through again and run through again to make the cave look better but you can also use other methods to do the same process um that's just set latent noise mask we could use a different one or you could use the vein code for in painting and bearman I'm just using the vision was it realistic Vision b-51 standard model you could use impainting for this there's an end painting model which has some benefits there's some disadvantages to it as well um really needs a whole nother video just for imprinting models but um generally in printing not models what was less changes it hired at higher dear noise values um which makes them a little bit better certain kind of things for in painting but not necessarily for everything that's really depends on what you're trying to accomplish and how much you've experimented with and learned it so as you'll notice I've just run it with fan code for in painting run it once and it's at all point no sorry 0.4 denoising which means it's going to be using that blank space that they incurred generally makes when you put masks on so make sure if you're running they encode you want to be in hiding noise preferably one and this should make a much better image this time and as always you know these um you can run this as many times as you want to get the images you want and you can see it's done a pretty good job um no major issues there's some if you zoom right in you can see there's some issues here and we fixed that in later processes by rerunning this again and again a couple of times you might run a sampler over the whole image as well in order to like unify any kind of weirdness between sections where you've done any masking so now down here is a alternate method which is using uh the detailer from Impact pack so impact pack is a series of nodes which are pretty complex if I open up this open up impact pack you'll see there's lots and lots and lots and lots and lots and lots and lots of things and they all plug into each other in weird ways and they can be really hard to learn um I would suggest that you check out the GitHub page if you have any problems with those the author of that has made a bunch of tutorials on how to wire up certain systems which are pretty useful but um generally speaking it has some great functionalities that um the basic nodes don't have which is why I'm using it here and the cool thing about detailer is that it generally speaking and do sections of your workflow um at higher resolution so if you set this up to do like a small area like a face and you run through detail uh it can bring more resolution to that section of your image um then would normally be in your image initially but there's all kinds of other cool stuff you can really tweak the settings a whole bunch so I'm going to run this through it's just using the same mask and it's using the same this image and this image to work they're just plugging in it's using a mask to Sig so I'm not using anything special into the segs thing um if you drag this out hang on and try and plug in stuff you'll find it's eggs and mask and then you'll be like hang on it plugs in segs again and why why is it doing these things right um that's because a lot of the impact pack you drag out it doesn't give you the best thing possible in the suggested nerds list so um it's a good idea to really open it up and actually have a look at the section that you're working with uh utility or whatever um to really kind of find the right nodes for it so I'm running a master's eggs which is basically the same as what uh van code is doing it's using a mask to select an area of the image you're just translating it into a different kind of data using a certain system essentially so if we run it it's going to render both I think but we run it it is doing the same thing as you can see in this section here and it should output us yeah see it's it's doing the same kind of thing as the other one above yeah that that's kind of how I would fix the top of the image it's like you do the same process to fix the gold here you could um okay well I've done this particular process so well you know I need to fix the next part so instead you go just make sure you save out the one you really want to work with so I'm going to save out this one and where is it wave image I'm just yeah yeah right now good we're good we're fine and I'm gonna open it up in here which gives us a modified image it's the same thing as before now you could just import this into an existing image so that you don't have to make all these layers again if you want you know whatever or this and then we run this change the opacity same processes last time and at least I'm not really going to bother with the background I don't think I'm just going to keep it and yes yes yes yes yes and we should have what we need okay and that needs to be open yeah I want this this to be a lot smaller gold pieces um I might actually I'm going to do want to see I'm going to reduce the size of this a little bit around this one give it a little bit more in terms of different side now you go around the colored toes or whatever it's it's not hugely necessary it will re-render the claws if you select them but what it is going to do is it is going to try and use a little bit of whatever is underneath we have set this up properly okay um and I'm Gonna Save It Out export all right that gives us another mask to work with and I'm just going to load it in now we're just selecting the gold pile and because we're changing this if I just leave this as is it's going to make a mound of rock probably so I'll pile of treasures gold Prime if we are lucky I can't use this one probably I'll just run it as easy and we'll just see what it does okay it has made the coins much much bigger that is not what I told you to do okay I mean they're more defined but um now my dragon is very very small and oops I have uh left this on so I'm just gonna to see correct uh yeah this is the right image there ignore this bit all right uh and it's done the same thing for both because um generally speaking uh these two processes don't change a huge amount so um they got the same seed or something but they're still doing the same thing because I have defined that they not defined as size and I've kept this very uh generic so um the things that apply normally to SD image generation also apply but only in the Mast area so if you want to make an image like a smaller thing you have to just like a small thing you have to describe it less will usually make a thing smaller image if you describe a thing more it will make it bigger in an image and add more detail though I probably need more detail here in order to make the um the coins themselves smaller so if we go add some detail words called the mouse coins yeah why not describing it more it's shooting in theory is necessarily going to do what I'm telling it to do if I decide that it film yeah so it's trying to make a tiny dragon now what I do today anyway so as you can see um because I don't really want to spend nine hours trying to refine this image um yeah this this is the process you would use to um do this kind of thing okay uh tutorial ended a little bit early um because of my poor decision making skills going into it um I'm gonna do turn this to a two-parter and second part is gonna be on compositing and um editing in a third party program and then bring it in there is a compositing tutorial already which you could probably use uh if you've used Photoshop whatever you can just put stuff in um and do it pretty easily same process already shown in this um not hard but I'm going to do a tutorial on it anyway and um yeah so there's a shortcut to the workflow in the description there is a shortcut to as well and chapters will allow you to skip things if you want to skip things I want you to put that like up the front of the video maybe I will maybe I will anyway um thanks for watching uh busy lately will be more tutorials but might take a little bit longer because um yeah super busy
Info
Channel: Ferniclestix
Views: 5,127
Rating: undefined out of 5
Keywords:
Id: cZ8YbS8X8Ag
Channel Id: undefined
Length: 44min 1sec (2641 seconds)
Published: Wed Sep 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.