ComfyUI img2img ControlNet IPAdapter ReActor Face Swap workflow #comfyui #stablediffusion

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi today we will see how you can take almost any photo you like even if it is of poor quality and use her composition and style while also Changing Faces to match we'll start with this photo which I downloaded from pxl docomo picture so we need to significantly improve the quality and also adapt the face to our client we will start with a very basic preparation cleaning up interferences in Photoshop we will return to photoshop later to create an accurate mask based on this photo and let's open comfywe we start with a very basic workflow of course you'll find the final workflow in the description of the video the workflow is compatible with LCM but it's just to make the demo a little faster in the positive prompt I wrote photo of a businesswoman wearing white shirt and black jacket Bank in the background I want to get the general look of the character but Place her in a different environment let's start by bringing the image to comfy with load image now we need to make the model understand what we want to take from the base image for this I will use the tile control net notice that I choose the advanced control net node because we will need the mask later we will click on Q and check that everything works nice everything works you just need to fix the proportions of the image so as not to get confused with it we will use the get image size node connect the source image to it and change the width and height to input connect everything and press Q again great now everything works we can move forward the next thing I would like to do is preserve the pose more and make sure we don't get all kinds of distortions in the hands and fingers for that I will add another control net this time on line art and it it is important to Remember to prepare the image for the control net so we will also use the aiio node for the pre-processor I lower the weights a bit to give the model some freedom and this is the result we got you can notice that we have the character and the photo is already of better quality we will fix the face later but we don't have the background we wanted here and that is because the control Nets also refer to the background of our original image to fix it we will use a mask and to create the mask I will use Photoshop let's bring the Photoshop in comfy node that allows you to connect images from Photoshop directly to comfy I will put a link to a video that shows how to install the plug-in and connect Photoshop to comfy we will also bring the bridge preview node which allows you to see the image and continue working with it and now we will move to photoshop to create the mask of course you can work with any other soft software the main thing is to create an accurate mask that separates the figure from the background after I created The Mask I copied and pasted it as a layer so that comfy can see the mask now back to comfy we click on Q and now we have a very precise mask that separates the character from the background and now all we have left to do is connect the mask to control net that's why we used Advanced control net but something important to note at the moment comfy doesn't understand that it's a mask so we lack a small step in between and that is to turn the image into a mask that comfy knows how to work with so we select the convert image to mask node and All That Remains is to select one of the color channels in our case it really doesn't matter which one and now the control Nets only work in the white area of the Mask we created allowing freedom for the model to produce the desired background now we have to improve the quality and replace the face which will suit our customer let's use IP adapter as a first step and later we will add another tool to get maximum accuracy to the original faces I load an IP adapter template that I already have ready in the description I will put a video that shows how easily these templates can be produced there is clip Vision here the model I will choose is plus face we will increase inrease the weights a bit and load the picture of our client and press Q please note that although we have chosen the face model there is also a change in other parts of the image and if we want the effect of the IP adapter mainly on the face area here too we can work with a mask I will use our original load image to produce a mask very quickly we will connect it to the IP adapter excellent now we can improve the quality and make the face more accurate to improve the quality of the image we will send everything to a second pass I simply copy the K sampler and press contrl plus shift plus v to paste with all connections I change the seed and decrease the denoise we need new vae and preview node and to connect the latent to the first Cas sampler and press q and you can play a little with the Deno to get slightly different results I like this result that still maintains a bit of the photographic quality as you can see it is not similar enough to the source image so let's add a reactor connect our result to the input image and the image of the face to the source image and connect it to the preview to see the result this is the image we started with this is the image after the second pass and this is the result after we did face swap so I hope you learned and we will meet in the next lessons you are of course welcome to subscribe to the channel comment and like if you liked it and most importantly have fun bye
Info
Channel: PixelEasel
Views: 2,935
Rating: undefined out of 5
Keywords:
Id: n7hJKXkGJrk
Channel Id: undefined
Length: 6min 12sec (372 seconds)
Published: Sun Mar 03 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.