diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-10-11 08:14:36 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-10-11 08:14:36 +0000 |
commit | 5de806184f6687e46cf936b92055146dc6cf2994 (patch) | |
tree | d84c2daa8798c3d2f8e99e17234a40065491182d /scripts/prompts_from_file.py | |
parent | 12c4d5c6b5bf9dd50d0601c36af4f99b65316d58 (diff) | |
parent | 948533950c9db5069a874d925fadd50bac00fdb5 (diff) | |
download | stable-diffusion-webui-gfx803-5de806184f6687e46cf936b92055146dc6cf2994.tar.gz stable-diffusion-webui-gfx803-5de806184f6687e46cf936b92055146dc6cf2994.tar.bz2 stable-diffusion-webui-gfx803-5de806184f6687e46cf936b92055146dc6cf2994.zip |
Merge branch 'master' into hypernetwork-training
Diffstat (limited to 'scripts/prompts_from_file.py')
-rw-r--r-- | scripts/prompts_from_file.py | 4 |
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()]
|