🚀 Flux2 Easy Swap: Head, Face or Outfit
About V1.1
Fixing Minor ıssues. Please upgrade your photobuf and mediapipe for "personmask" ( python_embeded\python.exe -m pip install --upgrade mediapipe protobuf google-cloud-videointelligence )
This workflow is optimized for the Flux model to perform natural and high-quality swaps of faces, heads, or outfits using PersonMaskUltra V2.
***HEAD OR FACE SWAP***
In the PersonMask Node
Img1 enable; body, clothe,accecories background
Img2 enable; face, hair
Prompt; It's best to leave this blank. Don't write anything. When you write something, the head size appears large and the colors may not match.
or
Prompt; "Replace the entire face and hair-style in image2 with the person image1. Make the face and body proportions perfect in the final image."
***OUTFIT CLOTHING SWAP***
In the PersonMask Node
Img1 enable; face,hair,body,background
Img2 enable; clothes
Prompt; "Style the person in image1, with every article of clothing in image2. In the final image, all the features of the clothes should be on the person in image1.
"
☕ Support My Work
Description
compatible with all flux2 (klein9b, 4b)
FAQ
Comments (26)
Hello. Do you happen to know where to find the GGUF versions of F2Klein? Thank you 🙌
Thx for the WF! Can you explain how you increase the output resolution?
There is a switch node. I named it "Empty 1 / Vae2". Bring it to "select2". Increase the resolution from Empty Flux 2 Latent. Remember, "select1" is the aspect ratio of Image 1.
Runs perfectly fine on Python 3.12, cu128 installation but can not work on latest version (cu130, Python 3.13 and later) since the 'mediapipe' module is not yet available on new versions. I would suggest OP to create an alternative version for newer versions working on Blackwell cards with up-to-date versions.
Thanks for the feedback. I think it's a "personmask" problem. I can't generate wf for Python 3.13. Everything I have is based on 3.12 and CUDA 13.0. Maybe I'll do it later. In other matters, qwen or my other flux wf. people have had good results with the comfy update.
@ugurdoyduk341 UPDATE: can be used with Python 3.12, cu130 version as well :) Thanks for your reply. Amazing workflow!
@barbarosdonmezer779 Doesn't work in either, how did you fix the sageattention error?
@exacomedia670 @exacomedia670 I reupload the zip file without sage for you . Please download and install it again. Dont forget to update all your nodes from manager. Update your comfy from.bat file. It is important.
@ugurdoyduk341 Works fine now, thanks!
@exacomedia670 you're welcome
@ugurdoyduk341 Btw any way to make manual masks in the workflow ? Because the automatic masking isn't really that good most of the time like struggles to recognize hats, sometimes half of the face is masked and stuff like that. Playing with confidence and LayerMask settings doesn't help that much.
@exacomedia670 No, unfortunately. What you're talking about is a bit of an "inpaint" issue. If I added that too, it would be a very heavy wf.
I get this error: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 2
Update comfy. Update all nodes. Download the file again. I'd try to fix.
Is there a way to use this without sageattention? Disabling it stops the workflow
Interesting. Try to delete it.
@ugurdoyduk341 Deleting it will break ComfyUI entirely. I mean "pip uninstall sageattention".
@exacomedia670 I reupload the zip file without sage for you . Please download and install it again.
@ugurdoyduk341 That worked! Thank you.
I have this issue where it always increases the new face size. Its only like 10% bigger but it def makes it look like its inpainted after and not the original image. Do you know why or how to fix this?
Hey try these; In the "person mask" section of Img1, only disable "face." Not the hair! Then enter the following prompt:"The character from image 1 with the face and hair of the woman from image 2. Preserving facial expression, keep everything else the same."
Where to download the custom nodes please ?
It is from the "missing custom nodes" in the upper right corner of Comfy manager.




