from os.path import dirname, basename, splitext, join as path_join, exists
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from random import randint
+from datetime import datetime
from stable.gen_params import GenParams, GEN_PARAMS
old_model_path = ''
maker = None
total = len(args.models) * args.quantity
+ start_time = datetime.now()
for i, model_name in enumerate(args.models):
new_model_path = path_join(args.models_dir, model_name)
if new_model_path != old_model_path:
gen_params.seed = start_seed + n + seed_corrector
path = save_path(i*args.quantity + n)
maker.set_gen_params(gen_params)
- index = i*args.quantity + n
- print(f'GENERATING {index}/{total}: {path}; {gen_params.to_str}')
+ index = i*args.quantity + n + 1
+ until_now = datetime.now() - start_time
+ until_end = ((until_now / index) * total) - until_now
+ print(f'GENERATING {index}/{total} '
+ f'(time so far: {until_now[:-7]} / '
+ f'estimated time left: {until_end[:-7]}): '
+ f'{path}; {gen_params.to_str}')
maker.gen_image_to(path)