Stable Diffusion - Inpainting Real Photos - Add/Remove Objects - Fooocus

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hello, everyone. Rodney here with Kleebz Tech,  and today I'm going to cover the mixing of   AI with real photos and editing real photos  using Fooocus. These techniques, of course,   will also work with editing your generated  images as well. The inpainting engine of   Fooocus is really one of its best features and the  primary reason why I started using it. And yes,   you can use it to edit real photos as well.  If you need instructions on getting started   with Fooocus, I do have videos that  cover that, but it is extremely simple. Now, if you're not familiar  with the inpainting in Fooocus,   I do recommend watching my other inpainting  video to familiarize yourself with the basics. Now, one of the big questions I'm going to  cover first is, I see a lot of people asking,   "How do you remove something from images?"  I'll cover that first. I'm going to show   it with a real photo, but this will work with  generated images as well. First, I'm going to   be running this just as the standard run.bat.  I have turned off all styles, and I'll explain   why in a moment. I'm just using the standard  Juggernaut. I find it's a good general purpose. Now, the reason I prefer not to use styles,  especially at first, you can always use them   later, but especially when you're removing  stuff. As I had somebody asking about how   to remove earrings from something, and they kept  inpainting, and it kept putting earrings. Well,   it turns out that they had the Masterpiece style  turned on, and the problem is when you're running   certain styles, you may not always know what's  in those styles and what's causing that problem. Well, as we can see here, if I pull up the  Masterpiece style, listed in here is earrings. So,   every time they were regenerating, they keep  getting earrings because that's what's listed   in here. So, be aware of that, and it's best to  work without styles, especially at first, or if   you're having any issues. If you're not having  any issues, then fine, use the styles, it works. We're going to also be turning on the input  image area here. We're going to be using   the inpaint section, as I mentioned.  One of my biggest questions I get is,   "How do you remove something?" And besides  what I mentioned before, if you're having   problems with the styles, a lot of times, it's  how you're doing it and how you approach it. So, I'm going to use this image here.  It's an actual image I found stock photos,   and a lot of times, people just want to  remove a person, for example. So in this one,   they'll mask over, let's say, the person.  So let's go over and mask this person out.   What a lot of people will do at this point  is they might go down and hit the modify   content and then they'll say remove.  That's not going to do anything. Erase,   that's not going to do anything either because  that's not how that works. All I'm going to put in   here is "empty beach" because I want it to be an  empty beach. I don't need to mention these other   people because it's not generating that area.  So, by putting "empty beach" in there, that's   going to be probably the best way to actually get  what I want. So I'll go ahead and generate that. Okay, and we have our empty beach now. I will  mention, I did not resize this image or anything   like that. Actually, the original image is, well,  yeah, the original image is like 5,000 by 2,845,   which is not an issue because what happens is  Fooocus is just working on that area there. So   that's not actually an issue with the image, but  sometimes you may want to resize it a little bit   to get things to match better. Let's pull up  that image to see how that came out. Overall,   it blends in pretty well. You can see  that it's not quite as clear now. What   I can do is resize that image before I do  it to get a better match on some of that   sort of stuff. A little bit of trial and  error, but overall, that's how that works. Now, something that a lot of people will try to  do is to use the modify content instead to remove,   but that doesn't always work. Now, I'm  going to show you, just to give you an idea,   let's say we actually went to the modify content  and I put "empty beach" here. This is probably   not going to do what I expect because I don't  totally prep ahead of time on all these things.   I don't make everything go perfectly for myself.  Probably should; it would make things a lot easier   when I'm editing these videos. But okay, well, I  think you see the results that we're getting. So,   using that modify content doesn't work well  for certain things like that. I do add that   adding things, it can work, but removing  things, it doesn't really work well for   that purpose. Like I said, your best bet is  put the actual prompt of like an "empty beach"   or an "empty table" if you want to remove  something from a table, something like that. The other thing you can do, if  you wanted to in this example,   is if we couldn't get it to do that  sort of thing, is in the image prompts,   I could just put a picture of an empty beach here  and use that as a guide to influence the removal. Okay, so now that I've covered the  removal of things from pictures,   let's cover adding things to pictures. So, for  this one, I'm going to use a photo that I took   a couple of years ago up in Vermont. It's  inside of an old abandoned house of a piano,   and so this one has black and white.  And this is the reason I used it,   to give you an idea of how this works. So I'm  just going to inpaint a certain area here. Now, for what I'm doing here, there are two  different options of doing this, and a lot of   times, you're going to try both of them because  sometimes it works better than others. It's hard   to say exactly why one works better than the other  on different images. So for this image, I'm going   to actually have a skeleton hand—oops—playing  piano. So, "skeleton hand playing piano." Now, if I just hit generate, most likely, what's  going to happen is it's not going to blend it in   perfectly with the black and white, although  the inpainting engine does a pretty good job   of blending things in. You do, I find, want to  mention that sort of stuff. I'm probably asking   for trouble since I'm putting a hand in here, but  I like to make things difficult for myself. Okay,   and these two came out, well, pretty bad. Ha, but  it did get the general style, which is what I'm   trying to show here. I did get actually much  better images earlier when I tried it. Now,   know these weren't perfect, but much better. And  as you can tell, Fooocus does a pretty good job at   blending things in. When it doesn't mess up, just  like normal generation when you're doing stuff,   it's not going to be any different  when using real images or generated in   inpainting. It's the same idea. So, you'll  obviously need to try several attempts,   but as you can see, it does a pretty good  job at getting it blended in pretty well. Now, another image, so let's say in here we  have this old abandoned house. I don't think   it's the same one. We're going to go ahead  and remove this prompt here. And this one,   I'm going to go ahead and use the modify  content, a ghost looking out the window. Okay, and we have our ghost in the window now. I'd  probably regenerate these a little more to get a   better... I probably would describe it a little  bit better as well down here and get that to   blend in and look better. You get the idea of how  that works. You could do it in the prompt up here,   but you're probably, in this sort of circumstance,  going to get better results using the modified   content because that's only a very small part.  So if you were to put it up here, you probably   wouldn't get it as many prompts. It probably  would take me a few more tries to do that. I'm going to go actually back to this original  image, so this is the original image that we   actually removed the person from. Same idea. I'm  going to go in here, and I'm going to put modified   content, and that's all I'm going to add into  here. I'm going to go ahead and hit generate. Okay, now we have our new images with our dog,  which, well, that's a pretty good-sized dog,   I would say. But there we go, that one's  much better. Now, the other option here,   we could do the same thing and do  it here and go ahead and generate. Okay, now we have our dog with the people. Now,  I do find, in my experience, usually this method   will blend things in, sometimes better, as far  as the size of the dog, where we saw with the   previous ones, the size was different with using  the modify content. But experiment to see which   ones you get the results that you like with. They  both have their advantages and disadvantages,   but they do both work. So when you use the  modify content down here, you do want to,   I find, remove anything from the top  prompt because it does intermix. So to   get best results, this is how I would  be doing it. Leave this prompt alone. Okay, so one thing also that I do like, as I've  mentioned about the Fooocus inpainting engine,   is it's very good at usually blending  things in. And so, for example,   we can take this old photo here. I have fun  with these old family photos sometimes. And so,   I'm going to just mask out an area here, just to  show you. I'm going to drop a car in here. Now,   I'm actually just going to use the main prompt  up here, and I'm just going to put "Put in a   Ford Model T, black and white photo, old  photo, faded, scratches, dull, blurred,   vintage, damaged photo." I've added some extra  weights in there. Play around with that to try   to get the results. I mean, the inpainting  engine does a decent job, but you do need to   kind of influence it with the prompt as well.  Some of these don't work as well as I'd hope,   but I can always add scratches or something to  the photo afterwards if you want to blend that in. So with this one, let's go ahead and give that  a shot. I'm still trying to find the best way   myself to get the old look. I do get it sometime.  As we can see here, it did a pretty good job with   some of these, blending them in. You might  want to go in, if you really wanted to make   it perfect, with some photo editing, add some  scratches and things like that. Like I said,   sometimes I do get those, and if you find  the right prompt, that might work as well. I haven't found any LoRAs that can help with that  yet, but I haven't done a lot of digging. I, of   course, could add a UFO in the background as well,  which I did earlier. That's actually, honestly,   what I do mostly: UFOs and monsters in the back  of old photos. Those are my big ones. So, really,   you can manipulate photos just like you would any  of the other generated images, for the most part. You can also use it as well for  variations afterwards, but obviously,   that's going to change the image. If you're  trying to actually get some pretty interesting   stuff and you're not as picky about that,  you can use the inpainting to get a start,   get something like this, then bring it  over the variation and do what you want   to do with the variations at that point  to get the final picture that you want. Well, hopefully, this gets you started with  using Fooocus on your photos and having some   fun. Don't forget, I do have plenty of other  videos on Fooocus and AI as well. Do check   those out. If you found this video helpful, please  consider hitting that like button. It does help,   at least that's what I've been told. And  keep on creating, and have a wonderful day.
Info
Channel: Kleebz Tech AI
Views: 3,600
Rating: undefined out of 5
Keywords: stable diffusion tutorial, stable diffusion, stable diffusion secrets, controlnet stable diffusion, fooocus tutorial, inpainting stable diffusion, stable diffusion install, foocus, convert image ai, stable diffusion ai, stable diffusion xl, inpainting ai, fooocus edit photos, fooocus real photos, generative fill, generative fill free, inpainting, add objects to photos, add objects to photos ai, remove objects ai, erase objects ai, erase unwanted objects from photos ai
Id: rMQQx6LLGSo
Channel Id: undefined
Length: 12min 4sec (724 seconds)
Published: Tue Mar 12 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.