aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBilly Cao <aliencaocao@gmail.com>2022-11-03 13:08:26 +0800
committerGitHub <noreply@github.com>2022-11-03 13:08:26 +0800
commit688aa2c9c1ce6cf65c43b6113411a185e294412b (patch)
tree32514b496717c3375988e180d51daa608b045e60 /scripts
parentfb1374791bf4b4c9b49de5378f29b12fdabcac97 (diff)
parentd98eacea40c7a40227f36dbea9cf92f90489310b (diff)
Merge branch 'AUTOMATIC1111:master' into fix_nowebui_arg
Diffstat (limited to 'scripts')
-rw-r--r--scripts/img2imgalt.py3
-rw-r--r--scripts/prompts_from_file.py9
2 files changed, 6 insertions, 6 deletions
diff --git a/scripts/img2imgalt.py b/scripts/img2imgalt.py
index 88abc093..964b75c7 100644
--- a/scripts/img2imgalt.py
+++ b/scripts/img2imgalt.py
@@ -166,8 +166,7 @@ class Script(scripts.Script):
if override_strength:
p.denoising_strength = 1.0
-
- def sample_extra(conditioning, unconditional_conditioning, seeds, subseeds, subseed_strength):
+ def sample_extra(conditioning, unconditional_conditioning, seeds, subseeds, subseed_strength, prompts):
lat = (p.init_latent.cpu().numpy() * 10).astype(int)
same_params = self.cache is not None and self.cache.cfg_scale == cfg and self.cache.steps == st \
diff --git a/scripts/prompts_from_file.py b/scripts/prompts_from_file.py
index 1be22960..d187cd9c 100644
--- a/scripts/prompts_from_file.py
+++ b/scripts/prompts_from_file.py
@@ -96,6 +96,7 @@ class Script(scripts.Script):
def ui(self, is_img2img):
checkbox_iterate = gr.Checkbox(label="Iterate seed every line", value=False)
+ checkbox_iterate_batch = gr.Checkbox(label="Use same random seed for all lines", value=False)
prompt_txt = gr.Textbox(label="List of prompt inputs", lines=1)
file = gr.File(label="Upload prompt inputs", type='bytes')
@@ -106,9 +107,9 @@ class Script(scripts.Script):
# We don't shrink back to 1, because that causes the control to ignore [enter], and it may
# be unclear to the user that shift-enter is needed.
prompt_txt.change(lambda tb: gr.update(lines=7) if ("\n" in tb) else gr.update(lines=2), inputs=[prompt_txt], outputs=[prompt_txt])
- return [checkbox_iterate, file, prompt_txt]
+ return [checkbox_iterate, checkbox_iterate_batch, file, prompt_txt]
- def run(self, p, checkbox_iterate, file, prompt_txt: str):
+ def run(self, p, checkbox_iterate, checkbox_iterate_batch, file, prompt_txt: str):
lines = [x.strip() for x in prompt_txt.splitlines()]
lines = [x for x in lines if len(x) > 0]
@@ -137,7 +138,7 @@ class Script(scripts.Script):
jobs.append(args)
print(f"Will process {len(lines)} lines in {job_count} jobs.")
- if (checkbox_iterate and p.seed == -1):
+ if (checkbox_iterate or checkbox_iterate_batch) and p.seed == -1:
p.seed = int(random.randrange(4294967294))
state.job_count = job_count
@@ -153,7 +154,7 @@ class Script(scripts.Script):
proc = process_images(copy_p)
images += proc.images
- if (checkbox_iterate):
+ if checkbox_iterate:
p.seed = p.seed + (p.batch_size * p.n_iter)