From: Christian Heller Date: Mon, 26 Aug 2024 06:14:29 +0000 (+0200) Subject: Add hints where inside a work batch we currently are. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/bar%20baz.html?a=commitdiff_plain;h=81f55952f9eee08e90b0d8d99a359017dd76e3cf;p=stable_plom Add hints where inside a work batch we currently are. --- diff --git a/browser.py b/browser.py index bd16e0e..9768443 100755 --- a/browser.py +++ b/browser.py @@ -202,8 +202,11 @@ class Window(Gtk.ApplicationWindow): if self.item_img: params_strs = [f'{k}: ' + str(getattr(self.item_img, k.lower())) for k in GEN_PARAMS] - self.metadata.props.label = '\n'.join([self.item_img.full_path] - + params_strs) + offset = len(self.unsorted_dirs) + 1 + position = self.selection.props.selected + 1 - offset + total = len(self.unsorted_files) + title = f'{self.item_img.full_path} ({position} of {total})' + self.metadata.props.label = '\n'.join([title] + params_strs) pic = Gtk.Picture.new_for_filename(self.item_img.full_path) pic.props.halign = Gtk.Align.START self.viewer.append(pic) diff --git a/stable.py b/stable.py index e601f00..29e1918 100755 --- a/stable.py +++ b/stable.py @@ -65,7 +65,7 @@ def parse_args(): temp_gen_paramses = [None] if parsed_args.defaults_from_stdin: temp_gen_paramses = [] - for line in [l for l in stdin.readlines() if len(l.rstrip())]: + for line in [line for line in stdin.readlines() if len(line.rstrip())]: temp_gen_paramses += [GenParams.from_str(line)] parsed_args.models = [] parsed_args.gen_paramses = [] @@ -119,6 +119,7 @@ def run(): from stable.core import ImageMaker # noqa: E402 old_model_path = '' maker = None + total = len(args.models) * args.quantity 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: @@ -144,7 +145,8 @@ def run(): gen_params.seed = start_seed + n + seed_corrector path = save_path(i*args.quantity + n) maker.set_gen_params(gen_params) - print(f'GENERATING: {path}; {gen_params.to_str}') + index = i*args.quantity + n + print(f'GENERATING {index}/{total}: {path}; {gen_params.to_str}') maker.gen_image_to(path)