FIX: Upscale Issue #68
+VersionUP (beta1) Thanks @NetCrafter99 for spotting
This commit is contained in:
parent
20cb6ee238
commit
f5c09b53fd
@ -2,7 +2,7 @@
|
||||
|
||||
<img src="example/ReActor_logo_red.png" alt="logo" width="180px"/>
|
||||
|
||||
<hr>
|
||||
<hr>
|
||||
[](https://github.com/Gourieff/sd-webui-reactor/commits/main)
|
||||

|
||||
[](https://github.com/Gourieff/sd-webui-reactor/issues?cacheSeconds=0)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
<img src="example/ReActor_logo_red.png" alt="logo" width="180px"/>
|
||||
|
||||
<hr>
|
||||
<hr>
|
||||
[](https://github.com/Gourieff/sd-webui-reactor/commits/main)
|
||||

|
||||
[](https://github.com/Gourieff/sd-webui-reactor/issues?cacheSeconds=0)
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user