aboutsummaryrefslogtreecommitdiff
path: root/scripts/prompts_from_file.py
diff options
context:
space:
mode:
authorssysm <me@theeditorstudio.com>2022-10-09 23:20:39 -0400
committerssysm <me@theeditorstudio.com>2022-10-09 23:20:39 -0400
commit6fdad291bd5a5edacedec73cf4d0e3852d00300e (patch)
tree5901473f27ea0410728150a1a6f2da373ea949b1 /scripts/prompts_from_file.py
parentcc92dc1f8d73dd4d574c4c8ccab78b7fc61e440b (diff)
parent45fbd1c5fec887988ab555aac75a999d4f3aff40 (diff)
Merge branch 'master' of https://github.com/AUTOMATIC1111/stable-diffusion-webui into upstream-master
Diffstat (limited to 'scripts/prompts_from_file.py')
-rw-r--r--scripts/prompts_from_file.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/prompts_from_file.py b/scripts/prompts_from_file.py
index 513d9a1c..b24f1a80 100644
--- a/scripts/prompts_from_file.py
+++ b/scripts/prompts_from_file.py
@@ -10,7 +10,6 @@ from modules.processing import Processed, process_images
from PIL import Image
from modules.shared import opts, cmd_opts, state
-
class Script(scripts.Script):
def title(self):
return "Prompts from file or textbox"
@@ -29,6 +28,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()]