YouTube to Text Converter

Transcript of ComfyUI Face Swap Workflow - Head Swap with QWEN & Flux (Tutorial)

Video Transcript:

Hello guys, I'm Soul Tuner and today I want to show you my new face swap or head swap workflow uh that giving that results. You can see them now. Uh so I want to tell you how does it work. Okay. Uh first of all uh we need to put our models here. Uh here are the links. I'm using last quen image edit 25509 uh version of this model. Uh also I'm using the goof format. So you can use uh FP8 uh but I prefer goof. I have RTX 3090. So um I'm using not standard workflow. Okay. Uh first of all let's try to make some images. Uh I will put the very hard image with woman with long hair. So we uh don't need only to change uh her face but also her uh hair should be removed or changed. And let's try to put our reference image. I prefer using cartoon characters because I'm working in my own style. So this workflow is working first of all with cartoon characters but also it can be used with photorealistic ones. Okay. First of all, I need to mask our first character from the in painting image. We need to mask every everything. Not forget uh any hair. It is uh important. So we erase we want to erase this part. Okay, good. Oh, sorry. We forget this small piece here. It's okay. Just save. Uh the second part is this reference image. Let's uh make this uh we can use much uh bigger brush here because here we don't need as much accuracy. Uh we just make it for uh cropping the image. So we don't need uh to be patient. So here we need the accuracy and here it is not necessary. Okay. The second part uh here we prepare our images. From these two images we receive three versions. The first one with blurred and also deleted um area for quent to place our reference image into this image into the first image. Yes. So cropped face where we can see all the details necessary uh and with fixed resolution also and uh DV pose preview and this is our control net that fix uh the position of our character. So let's try uh to generate this. As you can see I already tried some images. I launch uh the second uh part of our work workflow. It is uh image gen. Here we are using our three images in two case samplers. In first case sampler we use um all images as inputs. Um here you can see our prompt. You shouldn't change it or delete it. You can add something after this text but not erase or deletes. This is working prompt for replacing the head. Let's wait for the results. The first case sampler is making the first step that um make a big influence on the uh image at the end. So we already can see that it tries to place uh our character here. But if we give all power to the first case sampler, give it eight steps for example, our final character is wouldn't be as close uh to reference as it could be. So we use the second case sampler with increased influence of our reference. Here you can see our second uh text encode note in which we give not one but already two images of our reference character and also I give it uh image three with our control net to not um lose our position. But in some cases when you receiving uh bad um bad consistency in character, you can also increase this reference by adding this image to here. I prefer using control net because it works 80% of the time. We already can see how our K sampler is working. It's not very very fast. Um, but if you have a better uh video card, it will be better. Oh, before uh we continue to wait, uh I want to say something. Um I recommend the number of steps is uh eight. Yes, not six. Um you can try to low it, but remember if you increase them, you start to lose the consistency of the character. uh but you will uh get more detailed results. Um for example at steps four you will receive bad background but the consistency of the character may be better but this is just luck. So uh you can try to lower but I recommend it. Okay. As you can see we uh received our first image. It's okay when the background is not working. Uh good enough. Uh we will fix that this later. Now we just need to decide uh do we like our image or not. If we like it then we can proceed. But if not we can try second seat or even more. Let's try to generate the second image and uh decide which we like the most. For this one I don't prefer this plastic look. We can try to lower our steps or change the seat. I will try to change the seat just for you to show how it can be. Okay, the second image was generated. Oh, we received much better consistency of the background, but the character is still not uh quite the our reference image. It's good, but it's not perfect. For example, I want to hair be a little bit um another type. We already receive a good um a good image, but I am a I like uh the best results. So, I will try to use the next seed and maybe we receive u better results again. Here uh the third attempt and I think this is work the best. We can see some strange artifacts in this seat. It's okay. We can fix them later. Uh just u look on the face. It's perfect. I think it's uh our character is working on the computer and I'm already launched uh the output section to see the comparison comparison. Okay, let's uh continue. I fixed some uh problems. So, we have our uh result image and this uh big one already uh stitched. This node um places our image in the place of a big one. So our inpainting part are become the part of the big main image and it is saved in the main face coin folder that I created. So now we can continue our workflow. If you don't have any problems with background, you can already save uh the final result uh here in preview. But uh we have this problem. So let's try to fix them. Uh I turn off the bypass uh of these nodes. And as you can see, I already tested uh this one. So I painted a mask area here and there. And our flux model fixed this area. So I don't like the light on his head and it fixed it. And also he uh flux removed the strong line between uh in the middle of his neck. So it much smoother. Uh let's try to do uh something with our image. As you can see, we have uh some problems there. Let's open it in mask editor. And now we just need to show our model where we wanted to uh remove parts. Let's take a bigger brush. Flux fix is very smart. So it's not a big problem if you um take some more place but accuracy is better. So, I don't like this part. It's strange. I think it's should be removed. Oh, and her uh necklace. Okay, I think that's all. Let's try to remake this part. Save it and run it. As you can see, I use flux field dev model. Uh these links are here, so you can download them. uh you don't need use goof as me but uh I prefer it and it is very fast. I don't use any lors as you can see just a model and it already fixed our image. Oh sorry for that it is um not a good comparison comparison. So we let's fix this right now. We have this uh note but it should be from there. So let's try to run it again. Oh yeah, much better. So as you can see, all problems were corrected. It's working perfectly. Maybe her hair is not ideal, but it's okay. I I think it's it's normal. So now we have we can to make a preview. Let's run it. This will uh saved in demo folder. It's just for preview purposes. Now we can see our character, our new character, and our changed image. Oh no. Oh no. We forgot to connect the right connection. Sorry guys. Okay, now it's much much better. We don't have these problems. Um, if you don't have background noise, you can always just connect to preview and save if you want it. Let's try uh make some more things with it and try photo realistic ones. Here I will upload our Rick Estley and Koro rifts. So let's mask this one. This should be accurate. So I just take this part of the image. If we want him uh our network to play with hair for example, we just give it a little more space for example. Okay. Sorry Rest. It is for educational purposes. So so sorry. Okay. Can re is ready. not accurate. Let's prepare prepare our images. Oh, sorry again. Um, okay. One more important thing. Uh, if you want to play with color, uh, correction, I have placed, uh, the float constant here. So, you can change it to, for example, 0.5 or 0.8. Uh, and let's see what happens. the colors are matching better and sometimes this will increase the quality of your result. And if you see that your image is not uh perfectly color corrected, you should put uh another number here. So I prefer this one. Let's see. Okay, it's good. And start the generation. Um okay, let's try with this seat. Okay, we already received our first K sampler output. As you can see, uh we have the different man. It's okay for the start. Uh we just wait the second case sampler. But we already can see where the hair will be. So if we don't like the position the overall of this image, we can change the seat already. For example, click here to cancel run and then just change the seat already on this step. So if you can see that something goes very wrong, you can make it already. The second key sampler just tries to implement the character into the scene. So it sees the hair here. So it places the hair of our character here also. So if you don't like the position for example, you can already stop the run and try another seat. This is normal. Sometimes you can see there that the person is completely not look alike. For example, Kiana reefs. Okay, we received our image. Uh and I think uh this is working perfectly for the first seat. But I need to warn you that this workflow is not for realistic people. So um it is not always working very good at first time. Sometimes Quen is a little bit stupid. It is not working immediately. It needs several seats just to start to play with uh your uh reference image. So if you receive uh very different from the reference character at all at first uh this is okay. This is sometimes happens uh you can uh try to uh play with the parameters with the steps and of course with the seed uh you can try to add some prompt with uh your character uh so you will influence on the results. Okay but uh we have a good result already. So, we saved it in uh face swap but uh we need to correct this strange background and we already know how to do that. Uh one second please. We move this part. Mask it I think. Oh, and uh we have a big problem there. Let's try to fix this. And a little line here. So, we just try to make a more smoother effect. And let's run it. We need to wait until uh this model will be loaded in our VRAMm. You don't need to use uh goof model with Q8 size. You can uh take a smaller one if you don't have 24 GB of VRAM. For example, CU 6 is uh okay. Okay. Very good. We've received our result. And no, I think I think it's okay. We can we can try uh to play with another seed, but I think it's normal. So, we just make a very good um recall, but with another another character. And let's save this uh one. I think it's perfect. Perfect. Maybe maybe we can play with color correction. uh make it um a little bit darker here as you remember in color master node. Uh so we will uh we can decrease or increase this number to uh give Quen uh some more info also. We can uh play with seed as I said but um it uh it's okay. Let's just for experiment try to launch another seed. Okay, another seat is good also. I think it's okay for us. Um, oh, it's much better with background. It's much much better with background. Look, we don't even need to fix something. Maybe I think here or there but it can be uh saved already as output and we can also save it as preview already. Um but I will save only the first time. Um but I will remind you this is not perfect uh at first time for all images. uh you can try to play with uh different uh references, you can play you can play with different scenes. So if you have a problem with it and the last hint I want to tell you it's about the seed. Uh you don't need to change the seat for both K samplers. You can just uh plug this uh noise seed exactly in each case sampler. So uh for for example you like the position it's okay or it was very hard to receive uh similar uh result with similar character and you uh but you don't like the result image but you like for example the first case sampler image. So you leave this seat fixed and start to play with the second case sampler. So you uh will remake only the part of the image and maybe fix some uh strange parts. Okay, as you can see we receive a different result. Uh here background is not so great and this place is not so great. But uh I just wanted to show you how uh another seed works. So the position of his hair as you can see is still the same but uh other details um for example uh facial expression maybe and the background is not so consistent. So if you like this seed just uh try to change uh another case sampler seat. Okay that's all for today. Uh thank you very much for the watching. Sorry for uh my English. first tutorial for me, but I hope it can help you to improve your workflows. Uh, don't be afraid to experiment and ask questions. I will be happy to help you. Bye.

ComfyUI Face Swap Workflow - Head Swap with QWEN & Flux (Tutorial)

Channel: SoulTuner

Convert Another Video

Share transcript:

Want to generate another YouTube transcript?

Enter a YouTube URL below to generate a new transcript.