Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -397,6 +397,9 @@ def create_interface():
|
|
| 397 |
seed = gr.Number(label="Seed", value=0)
|
| 398 |
custom = gr.Textbox(label="Custom Input Prompt (optional)")
|
| 399 |
subject = gr.Textbox(label="Subject (optional)")
|
|
|
|
|
|
|
|
|
|
| 400 |
|
| 401 |
with gr.Accordion("Artform and Photo Type", open=False):
|
| 402 |
artform = gr.Dropdown(["disabled", "random"] + ARTFORM, label="Artform", value="disabled")
|
|
@@ -434,7 +437,6 @@ def create_interface():
|
|
| 434 |
add_caption_button = gr.Button("Add Caption to Prompt")
|
| 435 |
|
| 436 |
with gr.Accordion("Prompt Generation", open=True):
|
| 437 |
-
|
| 438 |
output = gr.Textbox(label="Generated Prompt / Input Text", lines=4)
|
| 439 |
t5xxl_output = gr.Textbox(label="T5XXL Output", visible=True)
|
| 440 |
clip_l_output = gr.Textbox(label="CLIP L Output", visible=True)
|
|
@@ -482,6 +484,23 @@ def create_interface():
|
|
| 482 |
outputs=text_output
|
| 483 |
)
|
| 484 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 485 |
return demo
|
| 486 |
|
| 487 |
if __name__ == "__main__":
|
|
|
|
| 397 |
seed = gr.Number(label="Seed", value=0)
|
| 398 |
custom = gr.Textbox(label="Custom Input Prompt (optional)")
|
| 399 |
subject = gr.Textbox(label="Subject (optional)")
|
| 400 |
+
|
| 401 |
+
# Add the radio button for global option selection
|
| 402 |
+
global_option = gr.Radio(["disabled", "random"], label="Set all options to:", value="disabled")
|
| 403 |
|
| 404 |
with gr.Accordion("Artform and Photo Type", open=False):
|
| 405 |
artform = gr.Dropdown(["disabled", "random"] + ARTFORM, label="Artform", value="disabled")
|
|
|
|
| 437 |
add_caption_button = gr.Button("Add Caption to Prompt")
|
| 438 |
|
| 439 |
with gr.Accordion("Prompt Generation", open=True):
|
|
|
|
| 440 |
output = gr.Textbox(label="Generated Prompt / Input Text", lines=4)
|
| 441 |
t5xxl_output = gr.Textbox(label="T5XXL Output", visible=True)
|
| 442 |
clip_l_output = gr.Textbox(label="CLIP L Output", visible=True)
|
|
|
|
| 484 |
outputs=text_output
|
| 485 |
)
|
| 486 |
|
| 487 |
+
def update_all_options(choice):
|
| 488 |
+
return {dropdown: gr.update(value=choice) for dropdown in [
|
| 489 |
+
artform, photo_type, body_types, default_tags, roles, hairstyles, clothing,
|
| 490 |
+
place, lighting, composition, pose, background, additional_details,
|
| 491 |
+
photography_styles, device, photographer, artist, digital_artform
|
| 492 |
+
]}
|
| 493 |
+
|
| 494 |
+
global_option.change(
|
| 495 |
+
update_all_options,
|
| 496 |
+
inputs=[global_option],
|
| 497 |
+
outputs=[
|
| 498 |
+
artform, photo_type, body_types, default_tags, roles, hairstyles, clothing,
|
| 499 |
+
place, lighting, composition, pose, background, additional_details,
|
| 500 |
+
photography_styles, device, photographer, artist, digital_artform
|
| 501 |
+
]
|
| 502 |
+
)
|
| 503 |
+
|
| 504 |
return demo
|
| 505 |
|
| 506 |
if __name__ == "__main__":
|