aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/prompts_from_file.py
diff options
context:
space:
mode:
authorTony Beeman <beeman@gmail.com>2022-10-08 00:46:39 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2022-10-09 08:16:38 +0000
commite2930f9821c197da94e208b5ae73711002844efc (patch)
tree75a4b2b5d10c337d2dffe2f55a33f9a6207bae28 /scripts/prompts_from_file.py
parent1ffeb42d38d9276dc28918189d32f60d593a162c (diff)
downloadstable-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/prompts_from_file.py')
-rw-r--r--scripts/prompts_from_file.py4
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()]