Merge remote-tracking branch 'origin/master'

This commit is contained in:
AUTOMATIC 2022-10-11 15:00:16 +03:00
commit dce7fc902a
2 changed files with 7 additions and 0 deletions

View File

@ -38,6 +38,7 @@ class Script(scripts.Script):
grids = [] grids = []
all_images = [] all_images = []
original_init_image = p.init_images
state.job_count = loops * batch_count state.job_count = loops * batch_count
initial_color_corrections = [processing.setup_color_correction(p.init_images[0])] 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): for n in range(batch_count):
history = [] history = []
# Reset to original init image at the start of each batch
p.init_images = original_init_image
for i in range(loops): for i in range(loops):
p.n_iter = 1 p.n_iter = 1
p.batch_size = 1 p.batch_size = 1

View File

@ -28,6 +28,9 @@ def apply_field(field):
def apply_prompt(p, x, xs): def apply_prompt(p, x, xs):
if xs[0] not in p.prompt and xs[0] not in p.negative_prompt:
raise RuntimeError(f"Prompt S/R did not find {xs[0]} in prompt or negative prompt.")
p.prompt = p.prompt.replace(xs[0], x) p.prompt = p.prompt.replace(xs[0], x)
p.negative_prompt = p.negative_prompt.replace(xs[0], x) p.negative_prompt = p.negative_prompt.replace(xs[0], x)