ADD: Enhancer UI Tumbler

Also catches 'face_enhancer' state for '--frame-processor' parameter
This commit is contained in:
Gourieff 2023-06-21 21:41:00 +07:00
parent 3f11992c98
commit 00127da7f8
4 changed files with 17 additions and 2 deletions

View File

@ -72,6 +72,12 @@ def parse_args() -> None:
roop.globals.execution_providers = decode_execution_providers(args.execution_provider)
roop.globals.execution_threads = args.execution_threads
#for ENHANCER tumbler:
if 'face_enhancer' in args.frame_processor:
roop.globals.enhancer = True
else:
roop.globals.enhancer = False
# translate deprecated args
if args.source_path_deprecated:
print('\033[33mArgument -f and --face are deprecated. Use -s and --source instead.\033[0m')

View File

@ -15,3 +15,4 @@ execution_providers: List[str] = []
execution_threads = None
headless = None
log_level = 'error'
enhancer = None

View File

@ -6,8 +6,9 @@ from typing import Any, List, Callable
from tqdm import tqdm
import roop
import roop.globals
FRAME_PROCESSORS_MODULES: List[ModuleType] = []
FRAME_PROCESSORS_INTERFACE = [
'pre_check',
'pre_start',
@ -29,12 +30,15 @@ def load_frame_processor_module(frame_processor: str) -> Any:
def get_frame_processors_modules(frame_processors: List[str]) -> List[ModuleType]:
global FRAME_PROCESSORS_MODULES
FRAME_PROCESSORS_MODULES: List[ModuleType] = []
if not FRAME_PROCESSORS_MODULES:
for frame_processor in frame_processors:
frame_processor_module = load_frame_processor_module(frame_processor)
FRAME_PROCESSORS_MODULES.append(frame_processor_module)
if roop.globals.enhancer == True:
frame_processor_module = load_frame_processor_module('face_enhancer')
FRAME_PROCESSORS_MODULES.append(frame_processor_module)
return FRAME_PROCESSORS_MODULES

View File

@ -74,6 +74,10 @@ def create_root(start: Callable[[], None], destroy: Callable[[], None]) -> ctk.C
keep_frames_switch = ctk.CTkSwitch(root, text='Keep frames', variable=keep_frames_value, cursor='hand2', command=lambda: setattr(roop.globals, 'keep_frames', keep_frames_value.get()))
keep_frames_switch.place(relx=0.1, rely=0.65)
# for FRAME PROCESSOR ENHANCER tumbler:
enhancer_value = ctk.BooleanVar(value=roop.globals.enhancer)
enhancer_switch = ctk.CTkSwitch(root, text='Enhancer', variable=enhancer_value, command=lambda: setattr(roop.globals, 'enhancer', enhancer_value.get()))
enhancer_switch.place(relx=0.1, rely=0.7)
keep_audio_value = ctk.BooleanVar(value=roop.globals.keep_audio)
keep_audio_switch = ctk.CTkSwitch(root, text='Keep audio', variable=keep_audio_value, cursor='hand2', command=lambda: setattr(roop.globals, 'keep_audio', keep_audio_value.get()))
keep_audio_switch.place(relx=0.6, rely=0.6)