Replies: 4 comments 1 reply
-
if it can help , here is the analyse_faces modified to set flags (in reactor_swapper.py) so it could be cool to have a check box : target is the centered character, the biggest , the one to the left etc. for now, i don't know how to use them in your "operate", but im on it ! note: seems that bbox is 2 points and not x,y,w,h
|
Beta Was this translation helpful? Give feedback.
-
added a default behavior : if one source and multiple random target face in result => target is the centered one in my previous code replace so the analyse return the already sorted array by x position then in operate (line ~800)
certainly to improve ! |
Beta Was this translation helpful? Give feedback.
-
this one seems to give good results
|
Beta Was this translation helpful? Give feedback.
-
Thanks, I was looking for this and it works pretty good. I think you should try posting in issues or a pull request, especially since reactor comfyUI node does Large>small faces for its face index but for some reason the webui plugin does left to right and it doesn't work good. |
Beta Was this translation helpful? Give feedback.
-
Hi
Im trying to swap a female on an image (txt2img) with many Male in background. (sincity lora)
but, the reActor stop on the first male in background and say "not same gender" and stop the swap (gender female/female checked in the UI)
so i looked in your code (im noob in python, not in php, java, javascript ;) )
it seems that the script fail to continue on target_image loop if target_face >0 and first check fail.
but, debuging the object traget_image with a pprint, i saw that there is a bbox property, and it gave me an idea :
if bbox from insightface analyse is x,y,w,h , may it could simple and cool to get w * h, then sort target_image by face area surface, and then target firstly the biggest face => so no more problem in image with people in background, whatever the gender or age
=> can be an option in UI (biggest is foreground = index0)
no ?
Beta Was this translation helpful? Give feedback.
All reactions