mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-04 03:10:21 +00:00
Fix for Prompts_from_file showing extra textbox.
This commit is contained in:

committed by
AUTOMATIC1111

parent
1ffeb42d38
commit
e2930f9821
@@ -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()]
|
||||
|
Reference in New Issue
Block a user