home · contact · privacy
Add hints where inside a work batch we currently are.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 26 Aug 2024 06:14:29 +0000 (08:14 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 26 Aug 2024 06:14:29 +0000 (08:14 +0200)
browser.py
stable.py

index bd16e0e7b6d90936adac3b38927b1d8551151a65..97684430a9be3fdef15f865e6b86495af77195d0 100755 (executable)
@@ -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)
index e601f00fa0e152cc4131da36c1aa1695cd5ab3dc..29e1918017579b41f51919591f60a97c4a4324dc 100755 (executable)
--- 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)