mirror of
https://github.com/s0md3v/roop.git
synced 2025-12-06 18:08:29 +00:00
Add temp path support
This commit is contained in:
parent
74db8113d2
commit
91c902d7b9
@ -45,6 +45,7 @@ def parse_args() -> None:
|
||||
parser.add_argument('--max-memory', help='maximum amount of RAM in GB', dest='max_memory', type=int, default=suggest_max_memory())
|
||||
parser.add_argument('--execution-provider', help='execution provider', dest='execution_provider', default=['cpu'], choices=suggest_execution_providers(), nargs='+')
|
||||
parser.add_argument('--execution-threads', help='number of execution threads', dest='execution_threads', type=int, default=suggest_execution_threads())
|
||||
parser.add_argument('--temp-path', help='select temp directory path', dest='temp_path', default=None)
|
||||
|
||||
# register deprecated args
|
||||
parser.add_argument('-f', '--face', help=argparse.SUPPRESS, dest='source_path_deprecated')
|
||||
@ -57,6 +58,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.temp_path = args.temp_path
|
||||
roop.globals.frame_processors = args.frame_processor
|
||||
roop.globals.headless = args.source_path or args.target_path or args.output_path
|
||||
roop.globals.keep_fps = args.keep_fps
|
||||
|
||||
@ -13,3 +13,4 @@ execution_providers = []
|
||||
execution_threads = None
|
||||
headless = None
|
||||
log_level = 'error'
|
||||
temp_path = None
|
||||
|
||||
@ -65,7 +65,10 @@ def get_temp_frame_paths(target_path: str) -> List[str]:
|
||||
|
||||
def get_temp_directory_path(target_path: str) -> str:
|
||||
target_name, _ = os.path.splitext(os.path.basename(target_path))
|
||||
target_directory_path = os.path.dirname(target_path)
|
||||
if roop.globals.temp_path and os.path.isdir(roop.globals.temp_path):
|
||||
target_directory_path = roop.globals.temp_path
|
||||
else:
|
||||
target_directory_path = os.path.dirname(target_path)
|
||||
return os.path.join(target_directory_path, TEMP_DIRECTORY, target_name)
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user