From 5c426fc7f28036bba4ba54c7ff869fcb5c15d4d3 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Mon, 26 Aug 2024 09:24:07 +0200 Subject: [PATCH] Add timing info. --- stable.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/stable.py b/stable.py index 29e1918..484ac6e 100755 --- a/stable.py +++ b/stable.py @@ -3,6 +3,7 @@ from sys import argv, exit as sys_exit, stdin 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 @@ -120,6 +121,7 @@ def run(): 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: @@ -145,8 +147,13 @@ def run(): 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) -- 2.30.2