Qwen Edit don't really like to do face swaps by prompting only. But there's way to force him to do this.
Whole trick is around marking some area in image in red color (just blob, square) passing additional image that would fit into that area (like face) and telling magic word "remove red area". Poor Qwen don't have a choice and have to put something in a place of red blob.
workflow uses rembg node to color masked area as red and openpose node to generate pose
you can use any color, will probably work
you can pass collage of 2-12 photos of person (in one image) with different perspectives and emotions (only face closeups)
you can use this trick to replace anything, like a hairstyle only, shoe, car (without openpose then)
all can be more automated with some face auto masking, but I want release simple stuff
if red is somehow passed to result image, like a red santa hat, make blob more round
it will come out plastic fantastic and not really matching the skin color, but light/shadows will be correct (skin tone matching anybody?)
you can add to prompt stuff like "wearing sunglasses", will totally work
if you mask 2 faces and pass 2 images (in one) of two different persons there's a good chance it will work (probably depends how distinct are those faces)
to increase quality you can cut out only face and torso (to provide body size context) and pass only that, then stitch it
you can use this red area trick to just perfectly inpaint/outpaint (no additional image)
In v2 I've added some stuff to use only masked area and leave rest of pixel untouched (exact same final image size). Sometimes qwen changes stuff outside red area, then this will not work.
You can try remove bypass on "Set Latent Noise Mask" and/or "ReferenceLatent Image 1" if things get weird, maybe it will help.
Description
FAQ
Comments (10)
I think he recognizes the mask, but he doesn't wear a red mask on his face. Why is that?
he? who is "he"? why is what? Can't understand this sentence
@Luntrix He is Comfyui with the workflow
That's so smart! -Thanks!
I'm sure you put a lot of work into it, and I appreciate that, but all I'm getting are blurry, indistinct, and poor-quality heads. I've been trying for two hours. The results are consistently bad. I'm at a loss.
Hum, must be something wrong with your workflow then. I never got blurry results.
@Luntrix Strange, I didn't change the workflow and tried it with Q8 gguf on a 3090.
Have you tested it with 2511? I also get strange results with mask not fully removed, like it has redness in final result
Nice work!!!!
Nice work, Love U


