faceswap handle no faces found

This commit is contained in:
Vladimir Mandic
2024-07-06 08:54:02 -04:00
parent 32dc4b3ab4
commit 6211c353aa
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -31,6 +31,7 @@ TODO:
- fix current step for higher order samplers
- fix control input type video
- fix reset pipeline at the end of each iteration
- fix faceswap when no faces detected
- multiple ModernUI fixes
## Update for 2024-06-23
+3
View File
@@ -22,6 +22,9 @@ def face_swap(p: processing.StableDiffusionProcessing, app, input_images: List[I
np_image = cv2.cvtColor(np.array(source_image), cv2.COLOR_RGB2BGR)
faces = app.get(np_image)
if faces is None or len(faces) == 0:
shared.log.warning('FaceSwap: No faces detected')
return
source_face = faces[0]
processed_images = []
for image in input_images: