aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJames Railton <JaRail@users.noreply.github.com>2023-03-23 10:44:25 -0400
committerJames Railton <JaRail@users.noreply.github.com>2023-03-23 10:44:25 -0400
commita9eef1fbb1dcdce4f0eb0b8e0f79dcd4c96713e1 (patch)
tree075abdc1ce921d728b7eee5a0121968f422b6559 /scripts
parent33b85391474098b021946a5f1d8e07f8a6d27aa2 (diff)
Fix "masked content" in loopback script
The loopback script did not set masked content to original after first loop. So each loop would apply a fill, or latent mask. This would essentially reset progress each loop. The desired behavior is to use the mask for the first loop, then continue to iterate on the results of the previous loop.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/loopback.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/loopback.py b/scripts/loopback.py
index 81577888..9c388aa8 100644
--- a/scripts/loopback.py
+++ b/scripts/loopback.py
@@ -42,6 +42,7 @@ class Script(scripts.Script):
all_images = []
original_init_image = p.init_images
original_prompt = p.prompt
+ original_inpainting_fill = p.inpainting_fill
state.job_count = loops * batch_count
initial_color_corrections = [processing.setup_color_correction(p.init_images[0])]
@@ -112,6 +113,7 @@ class Script(scripts.Script):
last_image = processed.images[0]
p.init_images = [last_image]
+ p.inpainting_fill = 1 # Set "masked content" to "original" for next loop.
if batch_count == 1:
history.append(last_image)
@@ -120,6 +122,8 @@ class Script(scripts.Script):
if batch_count > 1 and not state.skipped and not state.interrupted:
history.append(last_image)
all_images.append(last_image)
+
+ p.inpainting_fill = original_inpainting_fill
if state.interrupted:
break