From 9b7e474f26ddf34d58d45e430bf6c66bae153d19 Mon Sep 17 00:00:00 2001 From: Diego Porres Date: Mon, 26 Jun 2023 14:49:40 +0200 Subject: [PATCH] Save resulting latent After editing, when saving the image, you also save the resulting latent for continuing working on it later on (or e.g. generate interpolations) --- viz/capture_widget.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/viz/capture_widget.py b/viz/capture_widget.py index a63be95..72bf3cf 100644 --- a/viz/capture_widget.py +++ b/viz/capture_widget.py @@ -31,6 +31,7 @@ class CaptureWidget: viz = self.viz try: _height, _width, channels = image.shape + print(viz.result) assert image.dtype == np.uint8 os.makedirs(self.path, exist_ok=True) file_id = 0 @@ -44,6 +45,7 @@ class CaptureWidget: else: pil_image = PIL.Image.fromarray(image[:, :, :3], 'RGB') pil_image.save(os.path.join(self.path, f'{file_id:05d}.png')) + np.save(os.path.join(self.path, f'{file_id:05d}.npy'), viz.result.w) except: viz.result.error = renderer.CapturedException()