UPD: Less annoying msgs

This commit is contained in:
Gourieff | 古仁
2025-05-26 23:22:51 +07:00
parent 701259b66e
commit be2e8d549a
3 changed files with 14 additions and 9 deletions
+4 -3
View File
@@ -237,13 +237,13 @@ class reactor:
total_images = image_np.shape[0]
out_images = []
pbar = progress_bar(total_images)
for i in range(total_images):
if total_images > 1:
logger.status(f"Restoring {i}")
# if total_images > 1:
# logger.status(f"Restoring {i}")
cur_image_np = image_np[i,:, :, ::-1]
@@ -365,6 +365,7 @@ class reactor:
pil_images = batch_tensor_to_pil(input_image)
# NSFW checker
logger.status("Checking for any unsafe content...")
pbar = progress_bar(len(pil_images))
pil_images_sfw = []
for img in pil_images:
-1
View File
@@ -39,7 +39,6 @@ def nsfw_image(img_data, model_path: str):
logger.status("Ensuring NSFW detection model exists...")
if not ensure_nsfw_model(model_path):
return True
logger.status("Checking for any unsafe content...")
device = model_management.get_torch_device()
with Image.open(io.BytesIO(img_data)) as img:
if "cpu" in str(device):
+10 -5
View File
@@ -472,6 +472,11 @@ def swap_face_many(
target_faces = []
pbar = progress_bar(len(target_imgs))
if len(TARGET_IMAGE_LIST_HASH) > 0:
logger.status(f"Using Hashed Target Face(s) Model...")
else:
logger.status(f"Analyzing Target Image...")
for i, target_img in enumerate(target_imgs):
if state.interrupted or model_management.processing_interrupted():
logger.status("Interrupted by User")
@@ -493,19 +498,19 @@ def swap_face_many(
logger.info("(Image %s) Target Image the Same? %s", i, target_image_same)
if len(TARGET_FACES_LIST) == 0:
logger.status(f"Analyzing Target Image {i}...")
# logger.status(f"Analyzing Target Image {i}...")
target_face = analyze_faces(target_img)
TARGET_FACES_LIST = [target_face]
elif len(TARGET_FACES_LIST) == i and not target_image_same:
logger.status(f"Analyzing Target Image {i}...")
# logger.status(f"Analyzing Target Image {i}...")
target_face = analyze_faces(target_img)
TARGET_FACES_LIST.append(target_face)
elif len(TARGET_FACES_LIST) != i and not target_image_same:
logger.status(f"Analyzing Target Image {i}...")
# logger.status(f"Analyzing Target Image {i}...")
target_face = analyze_faces(target_img)
TARGET_FACES_LIST[i] = target_face
elif target_image_same:
logger.status("(Image %s) Using Hashed Target Face(s) Model...", i)
# logger.status("(Image %s) Using Hashed Target Face(s) Model...", i)
target_face = TARGET_FACES_LIST[i]
@@ -554,11 +559,11 @@ def swap_face_many(
if source_face is not None and src_wrong_gender == 0:
# Reading results to make current face swap on a previous face result
logger.status(f"Swapping...")
for i, (target_img, target_face) in enumerate(zip(results, target_faces)):
target_face_single, wrong_gender = get_face_single(target_img, target_face, face_index=face_num, gender_target=gender_target, order=faces_order[0])
if target_face_single is not None and wrong_gender == 0:
result = target_img
logger.status(f"Swapping {i}...")
if face_boost_enabled:
logger.status(f"Face Boost is enabled")
bgr_fake, M = face_swapper.get(target_img, target_face_single, source_face, paste_back=False)