aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/loopback.py
diff options
context:
space:
mode:
authorRory Grieve <rhrg500@gmail.com>2022-10-11 10:23:47 +0000
committerGitHub <noreply@github.com>2022-10-11 10:23:47 +0000
commit4b460fcb1a0224772949556fe0469da93245c532 (patch)
treefc647f9158ee0339623e8ae825123cb48ba817eb /scripts/loopback.py
parent255be75d30f41e089e499ec1c8462d6bf64dec24 (diff)
downloadstable-diffusion-webui-gfx803-4b460fcb1a0224772949556fe0469da93245c532.tar.gz
stable-diffusion-webui-gfx803-4b460fcb1a0224772949556fe0469da93245c532.tar.bz2
stable-diffusion-webui-gfx803-4b460fcb1a0224772949556fe0469da93245c532.zip
Reset init img in loopback at start of each batch (#2214)
Before a new batch would use the last image from the previous batch. Now each batch will use the original image for the init image at the start of the batch.
Diffstat (limited to 'scripts/loopback.py')
-rw-r--r--scripts/loopback.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/loopback.py b/scripts/loopback.py
index e90b58d4..d8c68af8 100644
--- a/scripts/loopback.py
+++ b/scripts/loopback.py
@@ -38,6 +38,7 @@ class Script(scripts.Script):
grids = []
all_images = []
+ original_init_image = p.init_images
state.job_count = loops * batch_count
initial_color_corrections = [processing.setup_color_correction(p.init_images[0])]
@@ -45,6 +46,9 @@ class Script(scripts.Script):
for n in range(batch_count):
history = []
+ # Reset to original init image at the start of each batch
+ p.init_images = original_init_image
+
for i in range(loops):
p.n_iter = 1
p.batch_size = 1