lucataco / modelscope-facefusion

Auto fuse a user's face onto the template image, with a similar appearance to the user

  • Public
  • 5.4K runs
  • GitHub
  • Paper
  • License



Run time and cost

This model runs on Nvidia A40 (Large) GPU hardware. Predictions typically complete within 9 minutes. The predict time for this model varies significantly based on the inputs.


Implementation of face fusion model

Image and face fusion

Given a template image and a target user image, the image-face fusion model can automatically fuse the faces in the user image into the template face image to generate a face image that is similar to the target face and has the appearance of the template image. Featured new images.

Model limitations and possible biases

It is recommended that the contours of the facial features in the image be complete without obvious occlusion, otherwise it may affect the face detection results and lead to poor fusion results.

The algorithm supports a certain angle of face lateralization, and can achieve better results when the lateralization angle does not exceed 30 degrees.

The face size in the image is recommended to be larger than 64×64 pixels, and the face area is recommended to be no larger than 2/3 of the entire image area. Otherwise, it will affect the face detection results and make the fusion operation impossible.

If the face shapes of the two faces are too different, it may affect the fusion effect of the edge areas of the face.