John6666 commited on
Commit
08abe29
·
verified ·
1 Parent(s): 58fed57

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -897,6 +897,7 @@ with gr.Blocks(theme=args.theme, elem_id="main", fill_width=True, fill_height=Fa
897
  update_task_options,
898
  [model_name_gui, task_gui],
899
  [task_gui],
 
900
  )
901
 
902
  load_model_gui = gr.HTML(elem_id="load_model", elem_classes="contain")
@@ -1084,13 +1085,13 @@ with gr.Blocks(theme=args.theme, elem_id="main", fill_width=True, fill_height=Fa
1084
  def run_clear_prompt_gui():
1085
  return gr.update(value=""), gr.update(value="")
1086
  clear_prompt_gui.click(
1087
- run_clear_prompt_gui, [], [prompt_gui, neg_prompt_gui]
1088
  )
1089
 
1090
  def run_set_random_seed():
1091
  return -1
1092
  set_random_seed.click(
1093
- run_set_random_seed, [], seed_gui
1094
  )
1095
 
1096
  with gr.Accordion("LoRA", open=False, visible=True) as menu_lora:
@@ -1257,8 +1258,8 @@ with gr.Blocks(theme=args.theme, elem_id="main", fill_width=True, fill_height=Fa
1257
  use_textual_inversion_gui = gr.CheckboxGroup(choices=get_embed_list(get_model_pipeline(model_name_gui.value)) if active_textual_inversion_gui.value else [], value=None, label="Use Textual Invertion in prompt")
1258
  def update_textual_inversion_gui(active_textual_inversion_gui, model_name_gui):
1259
  return gr.update(choices=get_embed_list(get_model_pipeline(model_name_gui)) if active_textual_inversion_gui else [])
1260
- active_textual_inversion_gui.change(update_textual_inversion_gui, [active_textual_inversion_gui, model_name_gui], [use_textual_inversion_gui])
1261
- model_name_gui.change(update_textual_inversion_gui, [active_textual_inversion_gui, model_name_gui], [use_textual_inversion_gui])
1262
 
1263
  with gr.Accordion("ControlNet / Img2img / Inpaint", open=False, visible=True) as menu_i2i:
1264
  with gr.Row():
@@ -1296,6 +1297,7 @@ with gr.Blocks(theme=args.theme, elem_id="main", fill_width=True, fill_height=Fa
1296
  change_preprocessor_choices,
1297
  [task_gui],
1298
  [preprocessor_name_gui],
 
1299
  )
1300
 
1301
  with gr.Row():
@@ -1355,7 +1357,7 @@ with gr.Blocks(theme=args.theme, elem_id="main", fill_width=True, fill_height=Fa
1355
  gr.Info(f"{len(sd_gen.model.STYLE_NAMES)} styles loaded")
1356
  return gr.update(value=None, choices=sd_gen.model.STYLE_NAMES)
1357
 
1358
- style_button.click(load_json_style_file, [style_json_gui], [style_prompt_gui])
1359
 
1360
  with gr.Accordion("Other settings", open=False, visible=True) as menu_other:
1361
  with gr.Row():
@@ -1419,6 +1421,7 @@ with gr.Blocks(theme=args.theme, elem_id="main", fill_width=True, fill_height=Fa
1419
  lora7_gui,
1420
  lora_scale_7_gui,
1421
  ],
 
1422
  )
1423
 
1424
  with gr.Accordion("Examples and help", open=True, visible=True) as menu_example:
 
897
  update_task_options,
898
  [model_name_gui, task_gui],
899
  [task_gui],
900
+ show_api=False,
901
  )
902
 
903
  load_model_gui = gr.HTML(elem_id="load_model", elem_classes="contain")
 
1085
  def run_clear_prompt_gui():
1086
  return gr.update(value=""), gr.update(value="")
1087
  clear_prompt_gui.click(
1088
+ run_clear_prompt_gui, [], [prompt_gui, neg_prompt_gui], show_api=False
1089
  )
1090
 
1091
  def run_set_random_seed():
1092
  return -1
1093
  set_random_seed.click(
1094
+ run_set_random_seed, [], seed_gui, show_api=False
1095
  )
1096
 
1097
  with gr.Accordion("LoRA", open=False, visible=True) as menu_lora:
 
1258
  use_textual_inversion_gui = gr.CheckboxGroup(choices=get_embed_list(get_model_pipeline(model_name_gui.value)) if active_textual_inversion_gui.value else [], value=None, label="Use Textual Invertion in prompt")
1259
  def update_textual_inversion_gui(active_textual_inversion_gui, model_name_gui):
1260
  return gr.update(choices=get_embed_list(get_model_pipeline(model_name_gui)) if active_textual_inversion_gui else [])
1261
+ active_textual_inversion_gui.change(update_textual_inversion_gui, [active_textual_inversion_gui, model_name_gui], [use_textual_inversion_gui], show_api=False)
1262
+ model_name_gui.change(update_textual_inversion_gui, [active_textual_inversion_gui, model_name_gui], [use_textual_inversion_gui], show_api=False)
1263
 
1264
  with gr.Accordion("ControlNet / Img2img / Inpaint", open=False, visible=True) as menu_i2i:
1265
  with gr.Row():
 
1297
  change_preprocessor_choices,
1298
  [task_gui],
1299
  [preprocessor_name_gui],
1300
+ show_api=False,
1301
  )
1302
 
1303
  with gr.Row():
 
1357
  gr.Info(f"{len(sd_gen.model.STYLE_NAMES)} styles loaded")
1358
  return gr.update(value=None, choices=sd_gen.model.STYLE_NAMES)
1359
 
1360
+ style_button.click(load_json_style_file, [style_json_gui], [style_prompt_gui], show_api=False)
1361
 
1362
  with gr.Accordion("Other settings", open=False, visible=True) as menu_other:
1363
  with gr.Row():
 
1421
  lora7_gui,
1422
  lora_scale_7_gui,
1423
  ],
1424
+ show_api=False,
1425
  )
1426
 
1427
  with gr.Accordion("Examples and help", open=True, visible=True) as menu_example: