From 45f284adb6f24cbad0987a1fa67e5f7c076f7bd6 Mon Sep 17 00:00:00 2001 From: Christoph9211 Date: Sun, 8 Jun 2025 16:54:47 -0500 Subject: [PATCH] Refactor variable names in process_frame_v2 for clarity --- modules/processors/frame/face_swapper.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/processors/frame/face_swapper.py b/modules/processors/frame/face_swapper.py index f1c65cd..f38046d 100644 --- a/modules/processors/frame/face_swapper.py +++ b/modules/processors/frame/face_swapper.py @@ -123,32 +123,32 @@ def process_frame_v2(temp_frame: Frame, temp_frame_path: str = "") -> Frame: if is_image(modules.globals.target_path): if modules.globals.many_faces: source_face = default_source_face() - for map_entry in modules.globals.source_target_map: # Renamed 'map' to 'map_entry' - target_face = map_entry['target']['face'] + for map in modules.globals.source_target_map: + target_face = map['target']['face'] temp_frame = swap_face(source_face, target_face, temp_frame) elif not modules.globals.many_faces: - for map_entry in modules.globals.source_target_map: # Renamed 'map' to 'map_entry' - if "source" in map_entry: - source_face = map_entry['source']['face'] - target_face = map_entry['target']['face'] + for map in modules.globals.source_target_map: + if "source" in map: + source_face = map['source']['face'] + target_face = map['target']['face'] temp_frame = swap_face(source_face, target_face, temp_frame) elif is_video(modules.globals.target_path): if modules.globals.many_faces: source_face = default_source_face() - for map_entry in modules.globals.source_target_map: # Renamed 'map' to 'map_entry' - target_frame = [f for f in map_entry['target_faces_in_frame'] if f['location'] == temp_frame_path] + for map in modules.globals.source_target_map: + target_frame = [f for f in map['target_faces_in_frame'] if f['location'] == temp_frame_path] for frame in target_frame: for target_face in frame['faces']: temp_frame = swap_face(source_face, target_face, temp_frame) elif not modules.globals.many_faces: - for map_entry in modules.globals.source_target_map: # Renamed 'map' to 'map_entry' - if "source" in map_entry: - target_frame = [f for f in map_entry['target_faces_in_frame'] if f['location'] == temp_frame_path] - source_face = map_entry['source']['face'] + for map in modules.globals.source_target_map: + if "source" in map: + target_frame = [f for f in map['target_faces_in_frame'] if f['location'] == temp_frame_path] + source_face = map['source']['face'] for frame in target_frame: for target_face in frame['faces']: