diff options
author | Tony Beeman <beeman@gmail.com> | 2022-10-08 00:46:39 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-09 08:16:38 +0000 |
commit | e2930f9821c197da94e208b5ae73711002844efc (patch) | |
tree | 75a4b2b5d10c337d2dffe2f55a33f9a6207bae28 /scripts | |
parent | 1ffeb42d38d9276dc28918189d32f60d593a162c (diff) | |
download | stable-diffusion-webui-gfx803-e2930f9821c197da94e208b5ae73711002844efc.tar.gz stable-diffusion-webui-gfx803-e2930f9821c197da94e208b5ae73711002844efc.tar.bz2 stable-diffusion-webui-gfx803-e2930f9821c197da94e208b5ae73711002844efc.zip |
Fix for Prompts_from_file showing extra textbox.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/prompts_from_file.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/prompts_from_file.py b/scripts/prompts_from_file.py index 513d9a1c..110889a6 100644 --- a/scripts/prompts_from_file.py +++ b/scripts/prompts_from_file.py @@ -10,6 +10,7 @@ from modules.processing import Processed, process_images from PIL import Image
from modules.shared import opts, cmd_opts, state
+g_txt_mode = False
class Script(scripts.Script):
def title(self):
@@ -29,6 +30,9 @@ class Script(scripts.Script): checkbox_txt.change(fn=lambda x: [gr.File.update(visible = not x), gr.TextArea.update(visible = x)], inputs=[checkbox_txt], outputs=[file, prompt_txt])
return [checkbox_txt, file, prompt_txt]
+ def on_show(self, checkbox_txt, file, prompt_txt):
+ return [ gr.Checkbox.update(visible = True), gr.File.update(visible = not checkbox_txt), gr.TextArea.update(visible = checkbox_txt) ]
+
def run(self, p, checkbox_txt, data: bytes, prompt_txt: str):
if (checkbox_txt):
lines = [x.strip() for x in prompt_txt.splitlines()]
|