It needs 1 threads or cores of course

This commit is contained in:
henryruhs 2023-06-04 20:05:17 +02:00
parent 01ab68708d
commit 86e4eed212
2 changed files with 3 additions and 2 deletions

View File

@ -198,7 +198,7 @@ def start(preview_callback = None):
key=lambda x: int(x.split(sep)[-1].replace(".png", ""))
))
status("swapping in progress...")
if roop.globals.gpu_vendor is None and roop.globals.cpu_cores > 0:
if roop.globals.gpu_vendor is None and roop.globals.cpu_cores > 1:
global POOL
POOL = mp.Pool(roop.globals.cpu_cores)
process_video_multi_cores(args.source_img, args.frame_paths)

View File

@ -86,9 +86,10 @@ def process_img(source_img, target_path, output_file):
def process_video(source_img, frame_paths):
do_multi = roop.globals.gpu_vendor is not None and roop.globals.gpu_threads > 1
progress_bar_format = '{l_bar}{bar}| {n_fmt}/{total_fmt} [{elapsed}<{remaining}, {rate_fmt}{postfix}]'
with tqdm(total=len(frame_paths), desc="Processing", unit="frame", dynamic_ncols=True, bar_format=progress_bar_format) as progress:
if roop.globals.gpu_vendor is not None and roop.globals.gpu_threads > 0:
if do_multi:
multi_process_frame(source_img, frame_paths, progress)
else:
process_frames(source_img, frame_paths, progress)