DemiPoto commited on
Commit
0a68b0d
·
verified ·
1 Parent(s): 3fa957a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -17
app.py CHANGED
@@ -51,6 +51,10 @@ def load_fn(models):
51
 
52
 
53
  load_fn(models)
 
 
 
 
54
 
55
  def test_pass(test):
56
  if test==os.getenv('p'):
@@ -285,26 +289,30 @@ def make_me():
285
  add_param=gr.Button("Add to the list")
286
  del_param=gr.Button("Delete to the list")
287
 
288
- with gr.Row():
289
- nb_images_by_prompt=gr.Number(2,label="Number of images by prompt:",interactive=True)
290
- nb_of_models_to_gen=gr.Number(10,label="Number of Models:",interactive=True)
291
- index_first_model=gr.Dropdown(choices=models, type="index", visible=True)
292
- index_first_model.change(lambda x :print(x),index_first_model,[])
293
  #gen_button = gr.Button('Generate images', scale=3)
294
  #stop_button = gr.Button('Stop', variant='secondary', interactive=False, scale=1)
295
  #gen_button.click(lambda: gr.update(interactive=True), None, stop_button)
296
-
297
- list_param=gr.Dropdown(choices=[["a",[["","",0,0,0,0,-1]]]], value=[["","",0,0,0,0,-1]], visible=False)
298
- disp_param = gr.Examples(
299
- label="list of prompt",
300
- examples=list_param.value,
301
- inputs=[txt_input,neg_input,width,height,steps,cfg,seed],
302
- outputs=[txt_input,neg_input,width,height,steps,cfg,seed],
303
- )
304
-
305
- add_param.click(fonc_add_param,[list_param,txt_input,neg_input,width,height,steps,cfg,seed],[disp_param.dataset,list_param])
306
- del_param.click(fonc_del_param,[list_param,txt_input,neg_input,width,height,steps,cfg,seed],[disp_param.dataset,list_param])
307
-
 
 
 
 
 
 
 
 
 
308
 
309
  js_code = """
310
 
 
51
 
52
 
53
  load_fn(models)
54
+
55
+ tags_plus_models_to_list=[]
56
+ for tag_plus_m in tags_plus_models:
57
+ tags_plus_models_to_list.append([tag_plus_m[0][2]])
58
 
59
  def test_pass(test):
60
  if test==os.getenv('p'):
 
289
  add_param=gr.Button("Add to the list")
290
  del_param=gr.Button("Delete to the list")
291
 
 
 
 
 
 
292
  #gen_button = gr.Button('Generate images', scale=3)
293
  #stop_button = gr.Button('Stop', variant='secondary', interactive=False, scale=1)
294
  #gen_button.click(lambda: gr.update(interactive=True), None, stop_button)
295
+
296
+ list_param=gr.Dropdown(choices=[["a",[["","",0,0,0,0,-1]]]], value=[["","",0,0,0,0,-1]], visible=False)
297
+ disp_param = gr.Examples(
298
+ label="list of prompt",
299
+ examples=list_param.value,
300
+ inputs=[txt_input,neg_input,width,height,steps,cfg,seed],
301
+ outputs=[txt_input,neg_input,width,height,steps,cfg,seed],
302
+ )
303
+ add_param.click(fonc_add_param,[list_param,txt_input,neg_input,width,height,steps,cfg,seed],[disp_param.dataset,list_param])
304
+ del_param.click(fonc_del_param,[list_param,txt_input,neg_input,width,height,steps,cfg,seed],[disp_param.dataset,list_param])
305
+
306
+ with gr.Row():
307
+ nb_images_by_prompt=gr.Number(2,label="Number of images by prompt:",interactive=True)
308
+ nb_of_models_to_gen=gr.Number(10,label="Number of Models:",interactive=True)
309
+ list_models_in_tag=gr.Dropdown(label="Tag",choices=[tags_plus_models_to_list],value=tags_plus_models_to_list[1][1])
310
+ index_first_model=gr.Dropdown(label="First model",choices=tags_plus_models_to_list[1][1], type="index")
311
+ list_models_in_tag.change(lambda x:gr.Dropdown(choices=x),list_models_in_tag,index_first_model)
312
+ with gr.Row():
313
+ disp_info=gr.Textbox(label="Info")
314
+ load_info=gr.Button(label="load info")
315
+ load.info.click(fonc_load_info,[nb_of_models_to_gen,index_first_model],[disp_info])
316
 
317
  js_code = """
318