ComfyUI : EASY Face Fixes & Swapping my wife's face into images!
ฝัง
- เผยแพร่เมื่อ 23 พ.ย. 2024
- I love the 1.5 stable diffusion model, but often faces at a distance tend to be pretty terrible, so today I wanted to offer this tutorial on how to use the Face Detailer custom node to fix those faces in any images that might be issues. To take this to the next level, we can also introduce Roop, which is a method of swapping a face with another one from a different image! In this case, I take a few images and swap in my wife's face, which works wonderfully! #roop #comfyui #stablediffusion
Grab the Impact Pack here, we are going to be using it often!
github.com/ltd...
Here is the Roop custom node I preferred to use, but there are a few options if this one doesn't work well for you: github.com/Gou...
Interested in the finished graph and in supporting the channel? Come on over to the dark side! :-)
/ @sedetweiler
thanks for creating these videos, they are a great help understanding comfyui workflows, I really like that you start from nothing and build up everything explaining along the way 👍
Another gem of a video.
I always get happy when I see a notification from you. Your shared knowledge gave me extra superpowers
Great to hear! Save the world my friend! Cheers!
great tutorial, there is not a single impact pack tutorial on youtube, dr ltt data has videos, but he is not saying anything and average man cannot understand, thank you for your detailed tutorial
I think he makes some of the best nodes, so I will be doing quite a few more of his packs.
Was waiting for this, any more tutorials on face details and swapping is appreciated
Just posted!
Great video, as usual. For whatever reason, I'm noticing that I get much better results from ReActor face swaps in Automatic 1111 as opposed to ComfyUI. In Comfy, the eyes always appear to be kind of glazed over or foggy (using the same reference face images.) Not yet figured out why there's such a big difference. Will be trying out the workflow presented in your video... see if there's something I'm missing. Thanks!
I get that as well when I don't use face restoration model. The new version of ReActor has face restoration, and it fixes this for me.
@@FinBoyXD Yes, I just noticed this a couple of days ago when I migrated my ComfyUI setup to a new drive and made sure everything was updated properly. Thanks for the feedback!
Please do a video to fix hands as well. You are very generous and thank you for that !!!!
That one is still pretty difficult to automate at this level, but I am sure it won't be long.
I usually fix the general shape in photoshop and when you then upscale it it usually looks pretty good
No module named 'insightface', I'm baffled. Says requirements for insightface has already satisfied, but when I launch comfyui this is the response i get.
Thanks a bunch for this guide. I've gotten it going time to do some face swapping. These videos are great for understanding comfyui.
Glad it helped!
Could use of efficiency nodes tidy this up? Thanks for giving to the community! Love the content and presentation.
Thank you for sharing. Could you please explain how "CLIPTextEncoderSDXL" differs from the default "CLIP Text Encode (Prompt)"? What are the functions of these options (crop_w, crop_h, target_width, target_height)? Can they be used for Laten Composition or something?
Its funny I tried this last night ,and got it to work right before I fell a sleep,Thanks for the Tutorial
I wanted to know about combinding 2 or more system, like depth controlNet with Canny ControlNet ,then to Facefix, then to upscale,idk is this possible?
Sure! You can do all that. That is why nodes are amazing. :-)
Small mistake, 12:30, you've set the value for the bbox_threshold instead of denoiser. Great video!
16:00, you're doing it again
Oh yeah! 😂 Thank you!
Is it safe to install those custom modes? I've heard some models are able to execute code (ones which are not .safetensor) How do I Check which models are installed when I install the node? How to stay safe?
Thanks for the swell new tutorial! I'm expect it takes considerable time and effort to make them so clear and concise, nonetheless, I'm eager for more! Please keep making them. :-)
Glad you enjoy them!
i getting this error
Error occurred when executing ReActorFaceSwap:
This ORT build has ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'], ...)
Many great tips in this one, I hope I remember them all! (I'm old)
I've used this face detailer node quite alot, but it often bombs out, not enough VRAM (I have 4GB), it's so good when it does work.
If anyone else has an Nvidia Potato™,tip: use an inpainting control net instead, not quite as good as the face detailer node, but uses less VRAM (I think)
I've been waiting for this! Thanks so much Scott! Keep up the good work.
Will do!
Another excellent video for the benefit of the community. Much appreciated.
My pleasure!
Thanks Scott really appreciate your tutorials
Glad you like them!
i learn something new from all your vids Scott. great job👍👍
Glad to hear it!
Oh my good god, being able to install and use the reactor node is a lot of fun for someone with no experience
It's terrible for everyone. 🙁
@@sedetweiler Happily, I persevered and got it working
@@genki831 how did you get it working? Quite a few people are having trouble with this one.
very helpful and useful. thanks for that. my only problem with it is the limits of colab.
It doenst let me install the ReActor Node for FomyUI, Face Swap nr. 122.. it says "IMPORT FAILED" i dont know why..
Thanks for the video, it seems great. I followed along and hit a snag adding Ultralytics at 6:08. I do not see ultralytics in the list.
Any ideas? I do have both impact nodes installed and my screen looks just like yours at that point.
It should be installed with the Impact Pack.
I dont find it either. I installed the impact pack in the comfyui manager
@@sedetweiler
@@sedetweiler doesn't come part of Impact pack.. installed it yesterday but nowhere to be found. It seems there's a subpack
Definitely learn something from your guide. Thank you and keep up your good work. I'm looking forward to your next video. 😊
Awesome, thank you!
Thanks Scott, great tutorial. I've tried swapping two faces but the second face lacks all detail. What's the solution? TIA
Templates! yes. that tip is going to save me a lot of time. Thanks!
Thanks for the workflow, really nice. But why are these add-ons, such as the Impact pack, still using pickle tensors? They are not safe, and can run malicious code easily. Can we as a community move to safetensors already?
I agree, but unfortunately that's all they offer at this time.
Is it like ADetailer in A1111 and it fixes ALL detected faces? If not, what ComfyUI node would act like ADetailer?
Watching this playlist from the first video and I still can't figure out why 'CLIPTextEncodeSDXL' is used so selectively. Eg. They were not used in the ControlNet and the Upscaler videos, so my wild guess is that it is okay to ignore them (and use general CLIPTextEncode, even for the SDXL models) when you're doing anything img2img effectively leaving the prompts blank and redundant.
Could we get a video showing how to do Image sequences/batch images in Comfy UI?
I get (IMPORT FAILED) error while trying to install ReActor Node for ComfyUI. Can anyone help about this problem? Thanks. It says "install failed: ReActor Node for ComfyUI"
very cool. thank you!
Love your work Scott!
I don't know how you are getting the search dialog to show up when adding nodes. how do I do that?
Many thanks!
Double click. :-) Thank you for the kind words!
AH!! Thank you!!!!!@@sedetweiler
Hi Scott, great video!
Is the 1.5 model you’ve used to create these images are SD 1.5 base model?
Correct. I love the 1.5 base.
Hello Scott, a couple of questions for you, where are the templates saved? I created your basic SDXL Base and it was working fine but then it disappeared🙁. I thought it would save the templates as a JSON file somewhere. Also being a programmer I create classes and methods to do a particular job should we treat workflows in the same way e.g create and save a workflow just for up scaling, a workflow for img2img etc. Some workflows I’ve seen look like a massive plate of spaghetti and they make my head hurt🤪
comfyui-reactor-node module for custom nodes: No module named 'insightface NEED HELP PLEASE
It is probably a better idea to ask the developer, as I am just a user on many of these.
hi great tuto i'm migrating from automatic 1111 to comfyui and i have one litlle question : is it working with other XL models than the base models ? Because i've tried with the XL nightvision and i've got an error
I don't know about the quality of some of the other models, but in general you can use any model that isn't broken.
I have options for reactor nodes but not Fast Face Swap, and none of the options I have look like the one in the video. Am confused.
I have the impact pack installed but I don´t have the UltraLyrics node... What´s up with that!? That's so annoying....
Hey Scott, nice work. Could you make a Tutorial how I can make my own Lora/Embedding so I can use my face on every model :) ?
Yes, that is coming up soon.
Looking froward to that tutorial!@@sedetweiler
Hello and thanks a lot for the work you share here. Unfortunately i'm stuck at the Impact pack install.. i canot get the pipe node, it dont show in the list.. have you got a explanation ? Help appreciated.
Just be sure everything is up-to-date. That is 99% the cause of most issues.
I am trying this technique. For some reason - and not all cases - there are green smudges and weirdnesses on their faces?!
I'm the guy who couldn't find IPadapterplus nodes. Well, I found it thanks to this video. You're a big help. I didn't think to check custom nodes in the manager until watching this, LOL. Bonehead mistake by me. Anyway, keep up the great work, I'm learning a lot from you.
Great to hear!
Can you make a video on how to use wildcard files in ComfyUI? I'm too dumb to figure it out.
😂 sure!
Just curious if you actually did make those images for Halloween, and if so, how'd it go over? :)
I didn't get a chance to do so, but I am going to get ahead of it for next year.
Ah, good. I'd hate to see such a silly idea unfulfilled hehe. Have fun!
I may be daft but, I can't find the custom content in the members area. Where would I find the custom graph? Thanks for everything you do!
It is in the goofy "posts" area on TH-cam here. Thanks for the support!
thanks! I’ve followed instructions to the letter but for whatever reason ReActor module just won’t show up. Any ideas? I promise I won’t ask every single question I have also ;)
@@jasondulin7376 is there an error in the console as things are loading? If so, it might be worth posting the error on the git for the reactor and he can help since he is the author. He has seen the video, so he can probably help better than I can, but he will have context.
Hey Scott .. great videos easy to understand . thanks ..you mentioned in a video somewhere how to update Comfyui via git bash .. could you refresh my memory on that please .. thanks
Sure! Are you using a mac or a PC?
@@sedetweiler pc thanks
very impressive
thank ya! just exploring different problems and how to solve them. thanks for taking the time to leave a comment!
Hello. Where can I download the workflow?
Maybe a dumb question, but is there a reason for loading the same model twice? Why not loading only one of them and connect it to both inputs?
Turns out I'm a lot more face blind that I previously thought I was! 😅
Thank you! Very good tutorial, i have a problem with reactor, result image is low resolution and blured, how can i fix this please?
Yeah, unfortunately Reactor has not released a model larger than 128x128, so I am only using it on smaller faces in a scene. There are some alternatives people are working on like SimSwap and VGGFace. Hopefully those are coming soon.
Any time I try to use this face fix in any other workflow, I get this error:
Error occurred when executing FaceDetailerPipe: mat1 and mat2 shapes cannot be multiplied (154x2048 and 1280x768)
You can't mix loras from 1.5 and sdxl
@@sedetweiler I am not using any loras and I still get this error, what can I do to fix it?
Hello Scott! Thank you so much for your valuable teachings, I really enjoy your method. I think I did something wrong in the installation or configuration because the face detailer always appear "Black", it can't recognize nothing. Can someone help me with this one? Thanksss! Oh I'm running confyUI in Windows 11.
Oh, well, I tried the face detailer with another image and it worked fine. The first one (the one that didn't worked, was like a portrait, the face was big), the second one (the one that did work) was similar to your example a big picture full body with a small face, and it worked perfectly.
This means that the face detailer only works with small faces?
hi very good tutorial, is there any alternative of ultralytics detector. I tried several times but it could not install. suggest something else can do same job. thanks
Not that I know of. It is a common issue and the only way I have seen someone get past it is a fresh install of Comfy with the Impact Pack nodes doing the heavy lifting. You can ask him on the git, as this is a common issue so he might have some ideas. Cheers!
Thanks so much for this, first face swap set up I've actually got good results from....only one concern if I can ask, am using good resolution images as input face yet I'm getting very soft results with he face in the saved image. Any ideas ? Am using exactly the same settings as you in the vid..
Yeah, the people that make the roop are only releasing their 128x128 model. Just waiting for an alternative.
bugger...@@sedetweiler
Great tutorial, but i dont know how i can disable or enable nodes , a few nodes you use is not in input and are disabled but for me is in input, l couldnt find any solution, could you help me?
Reactor works great but I would like the faces to be a bit more sharp as they are a bit fuzzy even when using highrez photos. Any settings that need to be adjusted to make the face less out of focus?
It's set to only make 128x128. The people behind it have not released a higher resolution version.
I cannot get the TODetailpipeSDXL to load. I have installed and reinstalled the IMPACT Pack, and it is not coming up. I am using the portable version of Comfyui.
Did you restart after installing it? Be sure everything is up to date.
The face swap is just not loading up for me and others are having this problem too. That's super sad for me. Otherwise a good video. So strange though, but I think the bit where you're like "I've already installed this so i don't have to show it" is sort of screwing us all over.
same here says, Import failed
Yeah, same :( @@deeptobhattacharyya3249
How to make the same person with comfyUI but i want to change what person do and have same same face body and hair example. How i can achieved it ?
Hey guys I had this issue where nothing would happen (a black box would appear in the face preview and no change would be made to the face when using the face detailer) turns out the image was just too big for it to look at. so i downscaled my image and it worked. just incase anyone is having the same issue
man scott, i so wish you were on the stable diffusion discord and could deal with all the toxic trolls :(
@@CyberwizardProductions I will have to poke my head in there. 😂
Lots of people having trouble getting this one to install. Please reply here when it gets updated again to be in a working state :)
You are a magician!
Followed this twice now and all I get is a black box on the "cropped refined" . Updated everything ComfyUI and all the addons? Any ideas?
I got it working its important to use an image that has a distorted face. If you use a " Perfect Face " you get a black box for the cropped refined Preview Image. So I distorted the face in Photoshop and reloaded it and then it worked
@@randymonteith1660 I tried doing the same,s till have the same problem with the preview image
Is it possible to throw this entire node setup at the end of the default setup to automate the process?
I am sure you could! You can really do anything with this.
Thanks for the tutorial. Following your steps, I got "segmentation fault" in the terminal and ComfyUI crashed. I'm running it on a Apple M2 Max with 96GB RAM. What might be the issue here? Thx.
I am really not sure. You can post in the comfy issues portion of the git repo and see if someone has ideas.
Thank you. It turned out my installation was incomplete, so it worked in some cases but didn't in others. I re-installed everything Python 3.11, Pytorch Nightly, and Comfy's requirements. Now it works. 👍
@@kedixia that is great to hear!
Followed this tutorial and works great. Since yesterday the reactor faceswap node has built-in face restoration. This improves the results a lot and sharpens the result. It also makes me wonder if it's still necessary to improve the face first with the facedetailer pipe before sending it to faceswap.
Yes, he did a nice job with it. I will probably update my workflow as well
Yes, he did a nice job with it. I will probably update my workflow as well
For some reason I don't have the Ultralytics option, even after installing Impact! Any ideas?
I just clicked update all, and it works now.
Now I'm getting FaceDetailerPipe issues " invalid index to scalar variable" any ideas?
I had to have Force_InPaint enabled for this to work. Now next problem - FaceSwap node isn't showing up. Why are there so many problems with this -_-
It's so new! Every day each of these nodes has several releases, so things will break constantly. It's one of the pains of being on bleeding edge. Extra bleeding will happen quite often.
Does ComfyUI work on a MacBook Pro (intel) / Monterey ?
MacBook Pro (15-inch, 2018)
Processor: 2.2 GHz 6-Core Intel Core i7
Memory: 16 GB 2400 MHz DDR4
Graphics: Radeon Pro 555X 4 GB
That reactor node install is an absolute train wreck compared to everything else used with comfyui. Hopefully there will be some good alternatives or its dependencies and design will be improved.
I agree. It was pretty involved
I spent a good 4+ hours today reading github posts, reinstalling, fresh installing, system install, portable install, upgrading and downgrading python and pip and cython and onxx. Haven't reached the finish line. I'm going to see what I can do with the IP adapter or maybe learn how to train a model for my face lol.
Did you ever get it to work @@Burnrate?
@@jadewilliams5507 I did on a completely fresh install and I downloaded all the related files and wheels needed before trying to run it.
Do you still get better results if you train a lora of your wife? Or using roop is better?
They seem to be about the same for something like this, but the roop was super fast and would be good when I didn't have a LoRA for the person I wanted in the shot.
I dont understand, do anyone else have a problem to get this node setup to work? My cropedrefined preview comes out all black
me. can't get it to work on windows, no matter which installation method I use.
Hi wanted to ask if anybody are currently having problem with the current version of Reactor conflicting with Impact on a Mac? On the windows, the node just won't load (problem with inswapper)
No idea, but often people will write the initial node and then no longer be interested in maintaining it. Not sure if that is the case, but it is something I do worry about.
Looks like he just posted a fix to a bug. Might want to try it again.
@@sedetweiler Okay so I found the problem. Turns out for the Mac version it has to use OS Ventura. But I haven't solve the windows problem. May I know what OS you are using for Windows?
@@sedetweiler I figured it out, the only way to be able to run the Reactor for me is to install ComfyUI through environment. Hopefully this helps anyone who is stuck.
ToDetailerPipeSDXL,where is it downloaded
It's in the Impact pack
I installed it, but did not find ToDetailerPipeSDXL, only ToDetailerPipe@@sedetweiler
I downloaded but reactor-node doesn't show when I try to add a node
Did you restart?
@@sedetweiler Resolved by referring to the Troubleshooting tab! Thanky u!
@@jorge7143 sry for bothering, have the same issue, cannot find a troubleshooting tab. Where is it?
@@jorge7143may I know what you are doing?
👋
🍸
Like so many of these videos, don't expect to actually build this example.
What GPU are you running this on?
3090
GTX1070
How do I just make AI photos based on me?
I just get error code :/
Unortunatly Reactor for comfyui seems pretty close to impossible to get going. doing all the steps, doing all the trouble shooting still no nodes showinh up. thanks anyways
Yeah that reactor project is a total trainwreck. Someone with no idea about releasing software made it with their weird environment built up from copy pasting stack overflow code.
@@Burnrate That's because you two don't know what you're doing. To do AI you need technical skill such as reading error messages and realizing you need to downgrade OpenCV to 4.6.x., and using onnxruntime-gpu with CUDA Toolkit 11. If that makes no sense, just give up and stick to lesser tools.
Why not use restore face? FaceD is better?
When this video was created, a lot of that stuff had not been written yet.
Very beautiful wife )
😊 thank you
Roop is too low-res for SDXL resolutions.
ahh, but you can GFPGAN the result ;-)
Seriously can i pay anyone for installing the Reactor node for me? I - wish id be kidding - am spending 2 days already installing it, and its always bringing up issues with the insightface software and a lot that is connected to it :'(
How many people hear have middle clicked a tutorial vid to try to move the work space? Lol. I can't be the only idiot.
I know I have. :-)
🍻
I followed your instructions and the Prog crashes. Here are the results showing. Any ideas?
got prompt
model_type EPS
adm 2816
making attention of type 'vanilla-xformers' with 512 in_channels
building MemoryEfficientAttnBlock with 512 in_channels...
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla-xformers' with 512 in_channels
building MemoryEfficientAttnBlock with 512 in_channels...
missing {'cond_stage_model.clip_l.logit_scale', 'cond_stage_model.clip_l.text_projection', 'cond_stage_model.clip_g.transformer.text_model.embeddings.position_ids'}
loading new
model_type EPS
adm 2560
making attention of type 'vanilla-xformers' with 512 in_channels
building MemoryEfficientAttnBlock with 512 in_channels...
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla-xformers' with 512 in_channels
building MemoryEfficientAttnBlock with 512 in_channels...
missing {'cond_stage_model.clip_g.transformer.text_model.embeddings.position_ids'}
loaded straight to GPU
loading new
loading new
Loads SAM model: F:\KI\ComfyUI_windows_portable\ComfyUI\models\sams\sam_vit_b_01ec64.pth (device:AUTO)
WARNING NMS time limit 0.550s exceeded
0: 640x640 1 face, 23.9ms
Speed: 470.6ms preprocess, 23.9ms inference, 1617.7ms postprocess per image at shape (1, 3, 640, 640)
semd to cuda:0
Detailer: segment upscale for ((136.65907, 184.97723)) | crop region (409, 512) x 1.5001825453135937 -> (613, 768)
pre: 52 .. 80 / 87
loading new
100%|##################################################################################| 28/28 [00:11
Why I do not have to detailer pipe SDXL node. I have the old version only🥲
Hi ! Try "Fetch Updates" in the manager and then you'll have an "update" button on the impact nodes when you go to "install custom nodes".
Many many thanks@@jayronnbulworth1915
Yup. Keep things current as they change daily
I can't seem to get this to install. Tried it through manager and git clone to the directory but it keeps telling me import failed. Though I saw facefusion as well.
have you had any luck with this? I've been also having a hard time
@@psycho-analyticgamer7452 Me too. The description says there are other options if this doesn't work, but doesn't say what options...
@@alekjwrgnwekfgn have you had any luck since then?
No luck on my end