Skip to content

Commit

Permalink
Added ability to move input & target faces order
Browse files Browse the repository at this point in the history
New CLI Arguments override settings
Small UI changes to faceswapping tab
  • Loading branch information
C0untFloyd committed Sep 4, 2024
1 parent a74cc6f commit 1f0414d
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 55 deletions.
7 changes: 4 additions & 3 deletions roop/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ def parse_args() -> None:
program = argparse.ArgumentParser(formatter_class=lambda prog: argparse.HelpFormatter(prog, max_help_position=100))
program.add_argument('--server_share', help='Public server', dest='server_share', action='store_true', default=False)
program.add_argument('--cuda_device_id', help='Index of the cuda gpu to use', dest='cuda_device_id', type=int, default=0)
args = program.parse_args()
roop.globals.cuda_device_id = args.cuda_device_id

roop.globals.startup_args = program.parse_args()
# Always enable all processors when using GUI
roop.globals.frame_processors = ['face_swapper', 'face_enhancer']

Expand Down Expand Up @@ -389,8 +387,11 @@ def run() -> None:
if not pre_check():
return
roop.globals.CFG = Settings('config.yaml')
roop.globals.cuda_device_id = roop.globals.startup_args.cuda_device_id
roop.globals.execution_threads = roop.globals.CFG.max_threads
roop.globals.video_encoder = roop.globals.CFG.output_video_codec
roop.globals.video_quality = roop.globals.CFG.video_quality
roop.globals.max_memory = roop.globals.CFG.memory_limit if roop.globals.CFG.memory_limit > 0 else None
if roop.globals.startup_args.server_share:
roop.globals.CFG.server_share = True
main.run()
3 changes: 2 additions & 1 deletion roop/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
target_path = None
output_path = None
target_folder_path = None
cuda_device_id = 0
startup_args = None

cuda_device_id = 0
frame_processors: List[str] = []
keep_fps = None
keep_frames = None
Expand Down
2 changes: 1 addition & 1 deletion roop/metadata.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
name = 'roop unleashed'
version = '4.1.4'
version = '4.2.0'
Loading

0 comments on commit 1f0414d

Please sign in to comment.