mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 01:04:32 +02:00
faceswap handle no faces found
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user