aboutsummaryrefslogtreecommitdiff
path: root/scripts/prompts_from_file.py
diff options
context:
space:
mode:
authorDepFA <35278260+dfaker@users.noreply.github.com>2022-10-10 00:38:54 +0100
committerGitHub <noreply@github.com>2022-10-10 00:38:54 +0100
commit4117afff11c7b0a2162c73ea02be8cfa30d02640 (patch)
treeaf26f1b0c9eac8c024d2e51ec8fb5ca4a4d45ed3 /scripts/prompts_from_file.py
parente2c2925eb4d634b186de2c76798162ec56e2f869 (diff)
parent45fbd1c5fec887988ab555aac75a999d4f3aff40 (diff)
Merge branch 'master' into embed-embeddings-in-images
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()]