Merge pull request #527 from zappityzap/pr-face-index-spaces

UPDATE: Allow using spaces in face index lists
This commit is contained in:
Евгений Гурьев | Eugene Gourieff | 古仁 2024-09-15 17:43:59 +07:00 committed by GitHub
commit 1242914609
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -245,10 +245,10 @@ class FaceSwapScript(scripts.Script):
if self.gender_target is None or self.gender_target == "No":
self.gender_target = 0
self.source_faces_index = [
int(x) for x in source_faces_index.strip(",").split(",") if x.isnumeric()
int(x) for x in source_faces_index.strip().replace(" ", "").strip(",").split(",") if x.isnumeric()
]
self.faces_index = [
int(x) for x in faces_index.strip(",").split(",") if x.isnumeric()
int(x) for x in faces_index.strip().replace(" ", "").strip(",").split(",") if x.isnumeric()
]
if len(self.source_faces_index) == 0:
self.source_faces_index = [0]