diff options
author | KyuSeok Jung <wjdrbtjr495@gmail.com> | 2022-11-05 18:08:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-05 18:08:45 +0000 |
commit | 9b7289c3493ba1f42aa5e7657d385124fec1f112 (patch) | |
tree | 37d86b581d265e06df7112e7a87f514de4702bc6 /scripts/prompts_from_file.py | |
parent | 45b65e87e0ef64b3e457f7d20c62d591cdcd0e7b (diff) | |
parent | b08698a09a257365238e43cc9023ce7cf9af73c4 (diff) | |
download | stable-diffusion-webui-gfx803-9b7289c3493ba1f42aa5e7657d385124fec1f112.tar.gz stable-diffusion-webui-gfx803-9b7289c3493ba1f42aa5e7657d385124fec1f112.tar.bz2 stable-diffusion-webui-gfx803-9b7289c3493ba1f42aa5e7657d385124fec1f112.zip |
Merge branch 'master' into master
Diffstat (limited to 'scripts/prompts_from_file.py')
-rw-r--r-- | scripts/prompts_from_file.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/prompts_from_file.py b/scripts/prompts_from_file.py index d187cd9c..3388bc77 100644 --- a/scripts/prompts_from_file.py +++ b/scripts/prompts_from_file.py @@ -83,13 +83,14 @@ def cmdargs(line): def load_prompt_file(file):
- if (file is None):
+ if file is None:
lines = []
else:
lines = [x.strip() for x in file.decode('utf8', errors='ignore').split("\n")]
return None, "\n".join(lines), gr.update(lines=7)
+
class Script(scripts.Script):
def title(self):
return "Prompts from file or textbox"
@@ -107,9 +108,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, checkbox_iterate_batch, file, prompt_txt]
+ return [checkbox_iterate, checkbox_iterate_batch, prompt_txt]
- def run(self, p, checkbox_iterate, checkbox_iterate_batch, file, prompt_txt: str):
+ def run(self, p, checkbox_iterate, checkbox_iterate_batch, prompt_txt: str):
lines = [x.strip() for x in prompt_txt.splitlines()]
lines = [x for x in lines if len(x) > 0]
@@ -157,5 +158,4 @@ class Script(scripts.Script): if checkbox_iterate:
p.seed = p.seed + (p.batch_size * p.n_iter)
-
- return Processed(p, images, p.seed, "")
\ No newline at end of file + return Processed(p, images, p.seed, "")
|