gokaygokay commited on
Commit
ec3403f
·
verified ·
1 Parent(s): 60d60a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -8
app.py CHANGED
@@ -384,7 +384,6 @@ You are allowed to make up film and branding names, and do them like 80's, 90's
384
  if len(sentences) > 1:
385
  output = ". ".join(sentences[1:]).strip()
386
 
387
- self.save_prompt(output)
388
  return output
389
 
390
  except Exception as e:
@@ -416,7 +415,11 @@ def create_interface():
416
  subject = gr.Textbox(label="Subject (optional)")
417
 
418
  # Add the radio button for global option selection
419
- global_option = gr.Radio(["disabled", "random"], label="Set all options to:", value="disabled")
 
 
 
 
420
 
421
  with gr.Accordion("Artform and Photo Type", open=False):
422
  artform = gr.Dropdown(["disabled", "random"] + ARTFORM, label="Artform", value="disabled")
@@ -502,12 +505,28 @@ def create_interface():
502
  )
503
 
504
  def update_all_options(choice):
505
- return {dropdown: gr.update(value=choice) for dropdown in [
506
- artform, photo_type, body_types, default_tags, roles, hairstyles, clothing,
507
- place, lighting, composition, pose, background, additional_details,
508
- photography_styles, device, photographer, artist, digital_artform
509
- ]}
510
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
511
  global_option.change(
512
  update_all_options,
513
  inputs=[global_option],
 
384
  if len(sentences) > 1:
385
  output = ". ".join(sentences[1:]).strip()
386
 
 
387
  return output
388
 
389
  except Exception as e:
 
415
  subject = gr.Textbox(label="Subject (optional)")
416
 
417
  # Add the radio button for global option selection
418
+ global_option = gr.Radio(
419
+ ["Disabled", "Random", "No Figure Random"],
420
+ label="Set all options to:",
421
+ value="Disabled"
422
+ )
423
 
424
  with gr.Accordion("Artform and Photo Type", open=False):
425
  artform = gr.Dropdown(["disabled", "random"] + ARTFORM, label="Artform", value="disabled")
 
505
  )
506
 
507
  def update_all_options(choice):
508
+ updates = {}
509
+ if choice == "Disabled":
510
+ for dropdown in [
511
+ artform, photo_type, body_types, default_tags, roles, hairstyles, clothing,
512
+ place, lighting, composition, pose, background, additional_details,
513
+ photography_styles, device, photographer, artist, digital_artform
514
+ ]:
515
+ updates[dropdown] = gr.update(value="disabled")
516
+ elif choice == "Random":
517
+ for dropdown in [
518
+ artform, photo_type, body_types, default_tags, roles, hairstyles, clothing,
519
+ place, lighting, composition, pose, background, additional_details,
520
+ photography_styles, device, photographer, artist, digital_artform
521
+ ]:
522
+ updates[dropdown] = gr.update(value="random")
523
+ else: # No Figure Random
524
+ for dropdown in [photo_type, body_types, default_tags, roles, hairstyles, clothing, pose, additional_details]:
525
+ updates[dropdown] = gr.update(value="disabled")
526
+ for dropdown in [artform, place, lighting, composition, background, photography_styles, device, photographer, artist, digital_artform]:
527
+ updates[dropdown] = gr.update(value="random")
528
+ return updates
529
+
530
  global_option.change(
531
  update_all_options,
532
  inputs=[global_option],