fixed the processor issue for MAC

pull/1133/head
Tamim Dostyar 2025-04-29 14:14:18 -05:00
parent c67afc1033
commit a4980474eb
2 changed files with 8 additions and 11 deletions

View File

@ -15,7 +15,7 @@ simple_map = {}
source_path = None source_path = None
target_path = None target_path = None
output_path = None output_path = None
frame_processors: List[str] = [] frame_processors: List[str] = ["face_swapper"]
keep_fps = True keep_fps = True
keep_audio = True keep_audio = True
keep_frames = False keep_frames = False

View File

@ -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: def set_frame_processors_modules_from_ui(frame_processors: List[str]) -> None:
global FRAME_PROCESSORS_MODULES global FRAME_PROCESSORS_MODULES
for frame_processor, state in modules.globals.fp_ui.items(): # Clear existing modules
if state == True and frame_processor not in frame_processors: 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_processor_module = load_frame_processor_module(frame_processor)
FRAME_PROCESSORS_MODULES.append(frame_processor_module) FRAME_PROCESSORS_MODULES.append(frame_processor_module)
modules.globals.frame_processors.append(frame_processor) except:
if state == False: pass
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
def multi_process_frame(source_path: str, temp_frame_paths: List[str], process_frames: Callable[[str, List[str], Any], None], progress: Any = None) -> None: 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: with ThreadPoolExecutor(max_workers=modules.globals.execution_threads) as executor: