Stable Diffusion - Photo to Anime or Anime to Photo - Fooocus

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hello everyone, Rodney here at Kleebz Tech.  Today, I'm going to attempt to show you how   to convert a realistic image to anime, and anime  back to realistic. This can also work with other   styles as well, but anime was a suggestion from  the comments that got me to make this video,   so that's what I'm going to go with. I'll  be doing this in Fooocus, but some of these   techniques will work with other interfaces.  If you haven't used Fooocus, I do recommend   adding it to your AI tool chest. Just download,  extract, and run, no installing python or any of   that sort of stuff. I do have many other videos  on using Fooocus that you can check out as well. Now, onto the topic of this video, realistic to  AI is where we will start. So, I'm going to be   using the standard run.bat file with this, but  I've already downloaded the anime checkpoint,   which we'll be using. You can use the checkpoint  that is downloaded when you launch the anime.bat   file preset, or any other one that you prefer.  By using a checkpoint specifically trained for a   certain style, like anime, it'll make conversion  much easier. For this, we'll be using several of   the image prompt options as well, so you want  to open up the image prompt area of Fooocus. Now, the first thing we're going to do is go over  to the describe section. We're going to drop the   image that we're going to use, this one here. So  this is the image we'll be using for this purpose,   and I'm going to change this over to the art  anime because I find this works much better   for this. Then, we're just going to describe this prompt in this image into the prompt,   and once that's done, we'll have the prompt  up here. One thing I do suggest doing is   going over this, making sure it got it  correct. If there's anything like the   hair colors off, or you want something  different, you can change that. Like,   I'm just going to remove 'realistic' from there  for now because it's not what I'm going for,   but you can leave that in there. And as you  will find, depending on how you do this,   text prompt may not have as big of an impact  depending on how much you use the image prompts. Now that we've done that, I can go over to  now. When you do the describe tab, one thing   you want to be aware of is, you need to go over  to the Styles. It's going to actually check off   certain Styles. So in this one, I'm actually not  going to check off any Styles initially. Now,   the other thing that we're going to want  to do as well is go over to the model,   uncheck any LoRAs we have enabled,  and I'm going to select the anime   pencil model. That's the one that comes  with the anime.bat preset for Fooocus,   but, like I said, you can use any of the  ones that you prefer. That's up to you. Now, we're going to want to change the settings.  So, I'm going to leave it on the quality settings   because that's what I prefer my images. I'm  going to change the resolution to match the   one that I'm working with as the reference  image. Now that I have all that set up,   I'm going to actually head over to my image  prompts down here and then I'm going to check   off Advanced because we do need the advanced  settings. And I'll go back, find my picture,   I'm going to drop one into each two  of these boxes. You can actually use   the face swap when you're doing these as well,  although I find unless you're doing close-ups,   it really doesn't make much of a difference. For  this one, I'm not going to be using the face swap. Here, we're ready to pretty much start converting.  Now, how you do this will depend on the results   that you're looking to get. Like, so for this, the  first one I'm going to be using is just the image   prompt here, and we're going to leave that as the  imageprompt for selection down below, and we'll   be adjusting the stop at and weight as we see fit  to generate the image that we want. Now remember,   the stop at setting determines when the image  prompt stops influencing the image generation. So,   with it at a 0.5, at halfway through,  50% away through the image generation,   this will stop influencing that. And think of the  weight is more as the volume, so that's how much   it's going to influence. So your stop at is for  how long, and then your weight is for how much.   It's the same for the Pyracanny, the CPDS, any  of those things. It all works the same way. Now,   the other box that we're going to  be changing is the second one. Now,   we have a choice between Pyracanny and CPDS. I'm  not going to dive into the details of those in   this video; I have covered them in one of  my other videos a little bit more detail.   But if you want to get an idea of how these  work, well, Pyracanny, the way that works,   let's get this onto image number one. I'm going to  go into our developer debug settings, and in here,   there is an option to debug the pre-processors.  Now, when you do that, all it's going to do when   I hit this generate button is, it's actually going  to show you the results of the Pyracanny here. So,   this is exactly what Pyracanny is going  to do; it's going to create all those   outlines for the image, and that's going  to be used as a guide when we generate. Now, the CPDS, basically, the way that  works is it removes the color from the   image for the most part, and the result  is pretty much a black and white image,   and that's used to guide the image generation.  So, each one works differently, and,   in all honesty, the results you're going  to get are pretty close in most of these,   but you're going to want to try each one to  see which one looks better because I found,   depending on which what type of what you're using  for an image, is going to determine which one   works better, in all honesty. So, it's hard to  say one is better than the other at this point. Now that we've got all those, now those are set,  I'm not going to change those at the moment. So,   let's go ahead and generate an image, and we'll  get an idea of what this does. I'm going to leave   these right now on the default settings, the  image prompt, and now let's go with Pyracanny,   and we'll go ahead and generate.  There we go, they're pretty close,   and for the most part, that gets you started  with creating the anime from a photograph. Now, you might be happy with the results that  you get immediately, but probably not. So,   using the settings on default here, I  find gives it a much more realistic look,   especially the background. If we  turn on one of the anime Styles,   we're actually going to see a little bit  different. So, let's go in here, and I'm   going to actually just turn on this anime style,  and now I'm going to do the same thing. Now,   I've actually left it on the same seed so we  can compare the results that we get from that. Okay, so on the left was with just the  default, no Styles. The one on the right   was with Styles. At this point, by using a lot  of the default settings, you're going to get   a mix of influence from the text prompt, the  image prompt, everything in the Styles. Now,   if you're going, if you want to get really,  you want to get it as close as possible,   the biggest thing you're going to want to do is  increase the weight and the stop ats on these. so I went ahead just to give  you an idea actually so I  don't run through all these so I did five generations  pyracanny and also five with  cpds the image prompt was on the full weight and Pyracanny and cpds were on full  weight which equal one and the stop   at was for one on both of these pyrocanny and CPDS the image prompt was at full weight  and what I started at was 0.2 for the   stop at and then I did .4 .6 .8 and then  a full 1.0 so as you can see in here you start off you have more of the influence  from now this was with the Styles attached   to it as well so you had more of an  influence from the Styles and the text prompt than from the image you still  had that influence from the image but not   as strong as you would with the  higher amounts so as we increase those stop ATS so that influence  carried on further and further   into the image it got closer and  closer to the original image and looking at both of these both cpds  and pyracanny are going to get pretty   close to getting the similar results and  I'm going to increase these all to one just to give you an idea of what  exactly this is going to come out   we'll use cpds for this one and I'll generate  this image so that's with the settings all at a much higher amount and it  ends up coming out much closer   to how the original image looked  even the dress the skirt is very close now obviously there's you know  we can do other stuff as well so I'm   going to show you just a quick example  with um a different one using a well let's go ahead and use so we'll go  in I'll show you the process again   so I'm going to use this image  here instead we are going to describe this into the prompt okay so  that looks good everything else I do   need to go over to the Styles I'm going  to uncheck these I will check off the anime one we do have a couple different  anime for this one actually let me go   with the MRE anime and let's bring  that image down here and I'm actually going to bring this in for the face  swap as well I'll increase that higher   weights now these I'm actually going to  leave these all at a high weight I want these to be as close as possible so  I wanted to have I want to have all   these weights up as much as possible for  what I'm going to do here but like I said that depends on what results your looking for. My goal is to get it to be  anime style but  look as close to the original as possible. I   did a pretty decent job, in my opinion.  And that's really all there is to doing   any of these. Like I said, this can be applied to  other things as well. You can apply it to comics,   you can apply it to any of these things. But,  depending on what checkpoint model you use,   the advantage for us using the anime  here is it does make it a lot easier   to convert to anime than if we were just  using a regular checkpoint and trying to   convert it to anime. I did find you're going  to get much better results doing it this way. Now, for the more interesting part that I actually  found to be more challenging, and it is, is going   from anime back to a realistic image. It can be  done, but the results are a little more difficult   to achieve, and the results may not be as good  as you're hoping for. It also depends a lot on   the source image, how extreme or how exaggerated  the anime is versus realistic. So, for example,   let's start off with the one that we originally  just went with and try to convert it back to a   regular image. The same idea: we drop them into  the image prompts like I did before. I'm going to   take the image and drop it into the describe tab.  I'm going to describe it into here the same thing.   Now that I've done that, we are going to change  the styles. For these, I'm actually going to use   these because, at this point, I want to get it  more towards the photograph as much as possible.   So I'm actually going to be using the Styles,  and I'm going to go in and change the model. So,   instead of using the anime model, obviously,  we now want to use an image model. I'm going   to use just the standard Juggernaut. You could  use a photorealistic one, anything that handles   photorealism. You're probably going to be better  off with, but you'll try different models to see   which one gives different results. Juggernaut's  more of a middle ground, so that's why I'm using   that one. It is a little more difficult,  but so we'll go with these as our defaults. I get the photograph in here; I put that into the  image prompt tab. Now, the difference in this is   the opposite, in a sense, of what we were doing  before. Before we wanted to really increase the   influence that these had on the resulting image,  I find when you're doing it the opposite direction   and going back to a realistic image, you actually  want to decrease a lot of that because it's going   to be a lot harder to get that image to go back  to a photorealistic one. I'll just give you an   idea here of what would happen if we go in, we'll  go with the defaults on these. I think it's 0.5,   and these are usually 0.5; the weight is 0.6. So  let's go ahead and see how this one comes out. Okay, so this actually worked on the default,  which I wasn't quite expecting, in all honesty.   But it all depends upon the image itself on how  well these are going to work, is what I've found.   So, usually, I find you're going to have to  turn these down considerably to get it to work,   but this one actually worked pretty well. I would  actually probably lower the weights just slightly.   I think it could be just a little better if we  were to decrease these weights a little bit. Overall, I'd say that one did pretty well,  actually. It did better than I thought it would,   so I don't really even have to go  any further with that one. Let's   go with this image here. So this one's  a lot more extreme. Let's go ahead and   describe that into the prompt. I'm going  to go back to the image prompts. Now here,   I do have to change the styles again because  it's going to change those on me. Sometimes you   can actually just put 'photo' in the beginning,  although when you're applying the photo style,   that shouldn't necessarily be necessary per  se. But if you're not using any of the Styles,   then definitely you want to start adding something  in there to tell it that you actually want a   photo of it. That would be the biggest thing. I'm  using those Styles in Fooocus to handle all that,   which adds those to the prompts, but otherwise,  you're going to want to signify in this prompt   that you want it to be a photograph so it  knows that. So it can try to convert it. So once this starts converting, it's going to  have a harder time because with these weights   and everything else, it most likely won't  be able to accomplish this. But let's give   it a shot and see what happens here. It'll  probably prove me wrong. So as we can see,   ithad a hard time overcoming the extreme  details of the anime, the exaggerated looks   versus trying to convert it back to realistic.  What I found here is you really need to, one,   change the prompt. I brought it in using the  anime, which brings in more of an anime prompt,   although it doesn't say it here. The problem  is if you go with the photographic described,   it's only going to describe a girl sitting at a  desk, and that's pretty much it. So you may get   better results in one aspect, but you're going  to lose a lot of those details if you do that. The biggest thing here, what you want to do  when you have that much of an issue fighting the   original style, is you're going to want to lower  some of these to a lower amount and just keep   trying until you get the results that you want.  A lot of times, you're going to end up with some   that are going to be a mix, actually, of realistic  images like the background and even the shirt,   the hands will look realistic, but the face  is still going to be more exaggerated because   what happens is as we're going through, we're  going to notice the stop at when the influence   stops. If the AI can then, from that point,  convert it to more of a realistic image,   it's going to have a harder time with the bigger  eyes and everything else getting that down. Now this one's a little bit different; you  can actually see that the hands and things   like that are starting to have more of a realistic  look. So it really comes down to, at this point,   adjusting a lot of these things. Like I said, you  can adjust the text prompt. This one's actually a   very difficult image, and it's actually the reason  I'm using this one because it's very hard to get   this one exactly where I'd want it. So we'll lower  that a little bit more and give it one more try. So as you can see, this one's much closer to being  realistic. Obviously, it does need a little bit of   fixing with those hands, but that was actually a  more difficult image, and I wanted to demonstrate   that. So those, you do definitely need to lower  the weights, and you'll have to keep decreasing   and playing with those until you can figure out  which one gives you the better results. On these,   you definitely want to try pyracanny and cpds;  you're going to have a harder time getting that   extreme of an image to look identical to the  original one. One that will work pretty well,   for example, would be this one. As we can see  from this image, the features aren't as extreme,   so this one should be a lot easier to bring over  and convert back to realistic. So what I'm going   to do is I'll drop that, put that, describe it  into the prompt. We're going to remove that, make   sure there's nothing in here to reference anime  because sometimes it will make some references   in there, which will make the prompt want to do  anime more. So you want to check those out. These,   I'm actually going to increase those. We have to  go back into the style because it's going to do   the same thing again, and everything else is fine.  I have it on the model that I want. So these,   I've got the weights higher, so on this one, the  first try came out and made it into a realistic   image. It may not be exactly as close to  the original that we'd want, and for that,   I would go through and just keep tweaking some of  these things. We could increase the weight. Let's   just try it with CPDS to see how that one does, a  little bit different, and we'll give this another   shot. So that one came out a little bit closer  because we increased the 'stop at' and weight,   and that had a bigger influence. So, when  you're going back in the other direction,   you're really going to want to do a lot of  tweaking with those to find the level that   you want. Because to get closer to the original  image but have it still be a realistic image   and not the anime, you're going to want to  keep increasing these up. And, you know,   for when you first start and then adjust  them until you get to a certain point,   you'll start seeing that it starts bringing in  the anime, then you can reduce those a little   bit until you can find that exact match of what  you're looking for. So, that is nowhere near as   easy to go from a photo to the anime than it  is, or any other style really, than it is to   go from those styles back to the realistic. But  it can be done, and they do come out pretty well. Now, there is another method that somebody  actually recommended when they were commenting.   They talked about trying this differently, so I  gave it a shot, and it actually does kind of work,   although it does depend on the image  itself. I didn't find that this method   worked well for the more extreme ones. So, for  something like this image here, I didn't find   this really worked at all. But when it came to  simpler images, it definitely would work. So,   this one, the idea was so I'm going to stick  with the same image, so the prompt is already   in there. So we do the same thing: you put  it in the describe tab prompt, and then the   suggestion was to put that in the main tab. So  I'm going to take that image, the original image,   now they said to basically mask off the whole  image, so we'll go ahead and completely mask   that. Then the suggestion was to turn this to  'improve detail,' leave this prompt empty because   it's actually going to use the prompt that's up  here; that'll actually work, it doesn't matter if   you take that and put it down here or leave it up  here, you're going to get the exact same results,   so that doesn't really make a difference. But  they did say to go to 'improve detail,' we'll   go ahead and give that a shot. It didn't really  do it exactly, you know, didn't change anything,   but I did play around with this a little more. I  don't know, there are a couple of images I tried,   and this actually worked just by default without  adjusting this at all. But for a lot of them,   I found I had to go in and actually, and now you  can do this, I did experiment with just a regular   in painting, but I did find this works better, but  then to change the denoising strength because if   you increase this a little bit, it's going to use  less of the original image when it regenerates.   So we'll go ahead and generate that now, and we  should see a little bit better result out of that.   So, as we can see, that actually did pretty good  there, compared to just the default. So you can   try this method. I've, you know, it really comes  down to each image seems to be different on how   which method works better. So a lot of times, you  try I find the image prompt, the first method I   showed, works the best overall in general, but  this one actually does work in some respects   better for certain images, especially if they're  not as extreme images. This one does pretty well,   but you I did find most of the time I did have  to go in and increase that denoising strength.   If I didn't, then a lot of times it didn't  necessarily get the results that I wanted.   Let's look at that and compare that; that was the  one that we generated using the image prompts,   and in my opinion, I actually think that's the  better one here. But like I said, each image   is different. Those are basically the couple of  different methods that you can experiment with   when it comes to bringing from the anime back to  the photo-realistic style. I would do the image   prompts first, adjust those levels if you don't  get what you want, then try the in-painting method   that I just showed; that can work as well. But  don't forget, if you're going to use this method,   you probably want to go into the developer/debug  mode and then increase that de-noise strength a   little bit up; you might not have to go too high,  it really depends upon the original image. The   more extreme it is, the more exaggerated, then  the harder it is, and you're going to have to   set that Denoising strength higher. It's almost  like turning the weight and everything down on   the image prompts is the same idea as increasing  the denoising strength. That should give you a   couple of different tools if you're looking to  do that. Like I said, it's a lot easier to go   from realistic to anime than it is to go back the  other direction. If anyone has any suggestions   for other ways of doing it or ways of improving  the results, please leave a comment because I   actually do learn quite a bit from the comments.  If you found this video helpful, please consider   hitting the like button because it definitely  does help. I'd also like to thank anyone who's   bought me a coffee; it's really appreciated.  And that's all for now, and have a great day.
Info
Channel: Kleebz Tech AI
Views: 7,002
Rating: undefined out of 5
Keywords: stable diffusion tutorial, stable diffusion, stable diffusion secrets, controlnet stable diffusion, digital art, fooocus tutorial, inpainting stable diffusion, stable diffusion install, foocus, photo to anime, anime to photo, anime to photorealistic ai, photo to anime ai, convert image ai, how to convert image into ai art for free, stable diffusion ai, stable diffusion xl, stable diffusion ai art, anime ai, anime ai generator, anime ai art, ai model, anime
Id: PuC2AVrQXTs
Channel Id: undefined
Length: 23min 35sec (1415 seconds)
Published: Fri Mar 08 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.