mirror of
https://github.com/s0md3v/roop.git
synced 2025-12-06 18:08:29 +00:00
Allow to initialize UI with source path and target path
This commit is contained in:
parent
5d6d438e23
commit
a722c3ff69
@ -56,7 +56,7 @@ def parse_args() -> None:
|
||||
|
||||
roop.globals.source_path = args.source_path
|
||||
roop.globals.target_path = args.target_path
|
||||
roop.globals.output_path = normalize_output_path(roop.globals.source_path, roop.globals.target_path, args.output_path)
|
||||
roop.globals.output_path = normalize_output_path(roop.globals.source_path, roop.globals.target_path, args.output_path) # type: ignore
|
||||
roop.globals.headless = roop.globals.source_path and roop.globals.target_path and roop.globals.output_path
|
||||
roop.globals.frame_processors = args.frame_processor
|
||||
roop.globals.keep_fps = args.keep_fps
|
||||
|
||||
@ -139,7 +139,7 @@ def select_source_path(source_path: Optional[str] = None) -> None:
|
||||
if source_path is None:
|
||||
source_path = ctk.filedialog.askopenfilename(title='select an source image', initialdir=RECENT_DIRECTORY_SOURCE)
|
||||
if is_image(source_path):
|
||||
roop.globals.source_path = source_path
|
||||
roop.globals.source_path = source_path # type: ignore
|
||||
RECENT_DIRECTORY_SOURCE = os.path.dirname(roop.globals.source_path)
|
||||
image = render_image_preview(roop.globals.source_path, (200, 200))
|
||||
source_label.configure(image=image)
|
||||
@ -157,12 +157,12 @@ def select_target_path(target_path: Optional[str] = None) -> None:
|
||||
if target_path is None:
|
||||
target_path = ctk.filedialog.askopenfilename(title='select an target image or video', initialdir=RECENT_DIRECTORY_TARGET)
|
||||
if is_image(target_path):
|
||||
roop.globals.target_path = target_path
|
||||
roop.globals.target_path = target_path # type: ignore
|
||||
RECENT_DIRECTORY_TARGET = os.path.dirname(roop.globals.target_path)
|
||||
image = render_image_preview(roop.globals.target_path, (200, 200))
|
||||
target_label.configure(image=image)
|
||||
elif is_video(target_path):
|
||||
roop.globals.target_path = target_path
|
||||
roop.globals.target_path = target_path # type: ignore
|
||||
RECENT_DIRECTORY_TARGET = os.path.dirname(roop.globals.target_path)
|
||||
video_frame = render_video_preview(target_path, (200, 200))
|
||||
target_label.configure(image=video_frame)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user