diff --git a/README.md b/README.md
index bdeb70b..e3f7c60 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
- 
+ 
[](https://github.com/Gourieff/sd-webui-reactor/commits/main)

[](https://github.com/Gourieff/sd-webui-reactor/issues?cacheSeconds=0)
diff --git a/README_RU.md b/README_RU.md
index 456242b..8aa634a 100644
--- a/README_RU.md
+++ b/README_RU.md
@@ -2,7 +2,7 @@
- 
+ 
[](https://github.com/Gourieff/sd-webui-reactor/commits/main)

[](https://github.com/Gourieff/sd-webui-reactor/issues?cacheSeconds=0)
diff --git a/scripts/swapper.py b/scripts/swapper.py
index 19c134e..f7b57de 100644
--- a/scripts/swapper.py
+++ b/scripts/swapper.py
@@ -262,6 +262,8 @@ def swap_face(
source_face_idx = 0
+ swapped = 0
+
for face_num in faces_index:
if len(source_faces_index) > 1 and source_face_idx > 0:
source_face, wrong_gender = get_face_single(source_img, face_index=source_faces_index[source_face_idx], gender_source=gender_source)
@@ -271,6 +273,7 @@ def swap_face(
target_face, wrong_gender = get_face_single(target_img, face_index=face_num, gender_target=gender_target)
if target_face is not None and wrong_gender == 0:
result = face_swapper.get(result, target_face, source_face)
+ swapped += 1
elif wrong_gender == 1:
wrong_gender = 0
if source_face_idx == len(source_faces_index):
@@ -291,7 +294,7 @@ def swap_face(
logger.info(f"No source face found for face number {source_face_idx}.")
result_image = Image.fromarray(cv2.cvtColor(result, cv2.COLOR_BGR2RGB))
- if upscale_options is not None and target_face is not None:
+ if upscale_options is not None and swapped > 0:
result_image = upscale_image(result_image, upscale_options)
else:
diff --git a/scripts/version.py b/scripts/version.py
index bef7891..42f3df6 100644
--- a/scripts/version.py
+++ b/scripts/version.py
@@ -1,5 +1,5 @@
app_title = "ReActor"
-version_flag = "v0.4.0"
+version_flag = "v0.4.1-b1"
from scripts.logger import logger, get_Run, set_Run