Stable Diffusion Inpainting Basics

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so I've generated this image drop hitmon and the image looks really good except it's missing one thing it's characteristic red tie so to fix this I'm going to send it to in painting so I'm going to click the button here Center inpate and now in paint has a lot of parameters and stuff so I'm going to go through each parameter one by one and give examples for each so the first thing I want to do to give actually Hitman the red tie is take out this prompt here and also take out the negative prompt and put in plain red eye because that's what I want and we're not done there what I need to do is if you hover over the actual image you should see a paintbrush and what you want to do is just take the paintbrush and paint over his black tie and if you look to the right you can also actually choose the brush size so if I need it smaller which I probably do I just do that and then paint over his black tiger oh like I said a lot of parameters so I'll just go over one at this very moment and that is mass content now with mask content you really only have two types you need to worry about original versus latent noise now you use original when you're changing something within the image so your let's say in our example we're changing from a block tie or a red tie so we'd be using original and you use latex noise for when you're adding something to the image so taking our image if we wanted to add a car we would have to use later noise because there's no actual call within the image itself and the reason you have to do this because original sort of uses the base image as a template so in our case what's going to happen when it's generating it's going to actually use the black Tire sort of a template to make the red tie which we want however if there's nothing for it to work on the result won't be very good let's say I wanted to add a card to the payment here if I left it our original what's going to happen it's sort of gonna use the payment as a template to make the actual core and it won't really look that good that's why we have to use later noise which would treat it as adding something new entirely new into the scene so we're going to keep it original and for the imping area I'm going to put it at only must and I will explain what this parameter does in the next example coming up so putting the seat at random to randomize Generations and I will click generate this was the image I was able to generate and it looked perfect Everything Is Right including the red tie that he now has so comparing it to the original we had this black tight and now we have his red tie over here so the image is looking pretty good and we finally have his characteristic red tie however we are still missing one more thing and that is his characteristic Nike Air Jordans that he wears on missions so to actually change the style of his shoes first I'm going to send to inpate to send the new image that we have so we can make changes on that and what you want to do is press the reset button over here and just click it multiple times just so that you should be able to see the start drawing text over here and we do this just to reset the actual in painting mask now for the prompt I'm gonna paste in Nike Air Jordans and I'm going to paint his shoes okay now that I've painted his shoes I'm gonna go into the settings and because we're only changing the actual type of issues we're going to keep it original again now for in paint area you get two options old picture and only must and the best way to explain it is with an analogy so take for example you have a house and in this house you want to add a new window with whole picture what you're saying you're sort of saying that we want to add this new window so we're going to demolish the whole house and build it all over again and remember to add the window and the reason why this is beneficial is because now the window will look much more natural in relation to the whole house because you're building it from scratch to accommodate the actual new window only mask is different in the house analogy in that it's like saying we're only going to demolish the place where we're gonna actually put in the window and not the entire house and because we don't have to spend the entire time demolishing the house and rebuilding it we're able to add much more detail into the window however because we're adding it sort of as an afterthought it won't look as natural in relation to the entire image and I'm going to demonstrate first I'm going to use hold picture so we're telling the image to create the whole picture again but also remember to add in the new Nike Air Jordans so it should look much more natural so I'm going to click generate now we have the Nike Air Jordans on his feet I must admit they don't look the very best but you must pay attention to one thing and that is the actual Direction your shoes are facing because now I'm going to use only must and show you the actual difference and I'm going to set a padding all the way down and I'll explain what that does right after this so I'm going to click generate so now that the image is generated you should notice one main thing and that is the shoes are facing the wrong way and this is what I meant with the house analogy about how the window wouldn't look natural what really happens is that because we said only a must stable diffusion will only focus on the in-painting area and nothing else it won't look at anything else and so it didn't know which way the actual person was walking whether he's walking backwards forwards left or right so that is the disadvantage of using only a must however there is a workaround around around this so if you remember I set the only musk padding to zero and what I was telling it is to not look anywhere else in the actual in painting area now if I increase the mouse padding I'm telling stable diffusion to look further outside the actual in painting area and you'll take that information as context so it start looking so in in our actual example maybe I'll start looking above his knees then above his torso the higher I set it and from that it'll be sort of able to work out which way we actually the person is actually walking so first I'm going to set it to a mass padding of around 80. and then click generate with this generation I was able to get the shoes facing the right way I actually had to increase the Moss padding to 120 to give stable diffusion enough context information to actually make the shoes face the right way and that should be it for in-bane area at least the basics of it now moving on to our next example I'm going to send the image back to Impe again press the reset button and now I'm going to actually I want to add litter in the street I think the pavement right now looks too clean so I'm going to add some litter and make it much more realistic so I'm going to paste in litter and I'm going to actually draw in the area where I want the litter to be now scrolling down in the case of mass content we are actually going to be using latex noise this time and not original because we're adding actually something new to the scene with regards to in paint area I'm going to keep it as whole picture and moving down we have denosing strength and denoising strength is how much you want the actual image to change it's recommended when you are using latent noise to slightly bump it up to maybe 0.8 0.9 and that's because because we're adding something new entirely new to the image you want a high denosing strength to actually make the changes go through okay so now that's generated we're able to see actually see the letter in the background over here and I'm going to keep it so I'm going to send it back to inpink reset the mask and now we're going to have our final change of today and that is I'm going to actually change his soup into a short sleeve polo shirt now because this is a dramatic change it might be slightly more challenging but I'm going to start painting in his actual upper body and now one thing you may notice with this in painting and actually all my other in paintings is that I wasn't very accurate without how I draw the actual in painting area I was quite rough with how I did it and the reason I could do that was because of this mask blur setting here and what it does it just basically blurs your in painting area so it's not as strict so you basically have much more leniency so for example when I was drawing the shoes I didn't have to make sure the shoes were actually a one-to-one with the actual in pink area and so by using mask blood you don't have to be that accurate so the higher you set it the much more lenient stable diffusion will sort of be with your inpate areas and they'll always say the more you're telling it to only focus on that in paint area and nothing else so I'm going to keep that at 4 for now and also what I'm going to do this time is instead of just showing you the final generation with all the mistakes cut out I'm going to actually give you a little time lapse of me actually trying to get to the final image and that's just because to show you that in painting is a very complex process and it's going to take a lot of generations and a lot of tweaking the parameters to actually get the actual final image you want so don't be disheartened for when you try in painting and your first few Generations don't look very good or what you wanted it really is a complex process and it does take a while to master so I'm going to start the time lapse now okay so now we have the final generation and just looking at the image I think it did a pretty good job maybe the Shadows up here could use a bit of fixing but it'll do for now and so comparing the final image with one of our original images so now we're able to change the image sort of dramatically so now he used to have a black suit all that stuff and now we've managed to change it and that is the power of in painting so if you like this tutorial please consider subscribing and if you have any comments regarding in painting any tips or tricks please put them down in the comments below as I said I'm no master so any tips would be helpful thank you and I'll see you in the next video
Info
Channel: Neo Professor
Views: 11,752
Rating: undefined out of 5
Keywords:
Id: nZkg4A9OgcY
Channel Id: undefined
Length: 11min 13sec (673 seconds)
Published: Sun Apr 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.