diff --git a/modules/globals.py b/modules/globals.py index 564fe7d..3ed01c0 100644 --- a/modules/globals.py +++ b/modules/globals.py @@ -15,7 +15,7 @@ simple_map = {} source_path = None target_path = None output_path = None -frame_processors: List[str] = [] +frame_processors: List[str] = ["face_swapper"] keep_fps = True keep_audio = True keep_frames = False diff --git a/modules/processors/frame/core.py b/modules/processors/frame/core.py index 7d76704..31eb605 100644 --- a/modules/processors/frame/core.py +++ b/modules/processors/frame/core.py @@ -42,18 +42,15 @@ def get_frame_processors_modules(frame_processors: List[str]) -> List[ModuleType def set_frame_processors_modules_from_ui(frame_processors: List[str]) -> None: global FRAME_PROCESSORS_MODULES - for frame_processor, state in modules.globals.fp_ui.items(): - if state == True and frame_processor not in frame_processors: + # Clear existing modules + FRAME_PROCESSORS_MODULES = [] + # Only load modules that are explicitly requested + for frame_processor in frame_processors: + try: frame_processor_module = load_frame_processor_module(frame_processor) FRAME_PROCESSORS_MODULES.append(frame_processor_module) - modules.globals.frame_processors.append(frame_processor) - if state == False: - try: - frame_processor_module = load_frame_processor_module(frame_processor) - FRAME_PROCESSORS_MODULES.remove(frame_processor_module) - modules.globals.frame_processors.remove(frame_processor) - except: - pass + except: + pass def multi_process_frame(source_path: str, temp_frame_paths: List[str], process_frames: Callable[[str, List[str], Any], None], progress: Any = None) -> None: with ThreadPoolExecutor(max_workers=modules.globals.execution_threads) as executor: