aboutsummaryrefslogtreecommitdiff
path: root/modules/shared.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-11-02 12:12:32 +0300
committerAUTOMATIC <16777216c@gmail.com>2022-11-02 12:12:32 +0300
commit4a8cf01f6f7f072cc9c67d6b31662384b212dd9c (patch)
tree2d9cf416afbff669f3aef3bfcaa11a7803e75bba /modules/shared.py
parente526f6b378e908d0a4a15661aaa1f67ecbaef1ff (diff)
remove duplicate code from #3970
Diffstat (limited to 'modules/shared.py')
-rw-r--r--modules/shared.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/shared.py b/modules/shared.py
index 04aaa648..e65f6080 100644
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -184,6 +184,20 @@ class State:
devices.torch_gc()
+ """sets self.current_image from self.current_latent if enough sampling steps have been made after the last call to this"""
+ def set_current_image(self):
+ if not parallel_processing_allowed:
+ return
+
+ if self.sampling_step - self.current_image_sampling_step >= opts.show_progress_every_n_steps and self.current_latent is not None:
+ if opts.show_progress_grid:
+ self.current_image = sd_samplers.samples_to_image_grid(self.current_latent)
+ else:
+ self.current_image = sd_samplers.sample_to_image(self.current_latent)
+
+ self.current_image_sampling_step = self.sampling_step
+
+
state = State()
artist_db = modules.artists.ArtistsDatabase(os.path.join(script_path, 'artists.csv'))