DemiPoto commited on
Commit
ad67e2e
·
verified ·
1 Parent(s): bf06308

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -269,6 +269,7 @@ def fonc_del_param(lp,txt_input,neg_input,width,height,steps,cfg,seed):
269
 
270
  def fonc_load_info(nb_of_models_to_gen,index_tag,index_first_model):
271
  str_temp=""
 
272
  if index_first_model+nb_of_models_to_gen>len(tags_plus_models[index_tag][2]):
273
  if nb_of_models_to_gen>len(tags_plus_models[index_tag][2]):
274
  str_temp+="warning : to many model chosen"
@@ -276,12 +277,13 @@ def fonc_load_info(nb_of_models_to_gen,index_tag,index_first_model):
276
  str_temp+="warning : first model to close to the last model"
277
  nb_of_models_to_gen= len(tags_plus_models[index_tag][2])-index_first_model
278
  str_temp+=f" - only {nb_of_models_to_gen} will be use\n\n"
279
- str_temp+="list of models use: (from "
280
- str_temp+=f"{index_first_model+1}/{len(tags_plus_models[index_tag][2])} to {index_first_model+nb_of_models_to_gen}/{len(tags_plus_models[index_tag][2])})\n"
281
  for i in range(nb_of_models_to_gen):
 
282
  str_temp+=f"{tags_plus_models[index_tag][2][i+index_first_model]}\n"
283
 
284
- return nb_of_models_to_gen,gr.Textbox(str_temp)
285
 
286
  def make_me():
287
  with gr.Column():
@@ -331,9 +333,10 @@ def make_me():
331
  index_first_model=gr.Dropdown(label="First model",choices=list(tags_plus_models[1][2]), type="index")
332
  index_tag.change(lambda i:gr.Dropdown(choices=list(tags_plus_models[i][2])),index_tag,index_first_model)
333
  with gr.Row():
 
334
  disp_info=gr.Textbox(label="Info")
335
  load_info=gr.Button("Load info")
336
- load_info.click(fonc_load_info,[nb_of_models_to_gen,index_tag,index_first_model],[nb_of_models_to_gen,disp_info])
337
 
338
  js_code = """
339
 
 
269
 
270
  def fonc_load_info(nb_of_models_to_gen,index_tag,index_first_model):
271
  str_temp=""
272
+ list_models_temp=[]
273
  if index_first_model+nb_of_models_to_gen>len(tags_plus_models[index_tag][2]):
274
  if nb_of_models_to_gen>len(tags_plus_models[index_tag][2]):
275
  str_temp+="warning : to many model chosen"
 
277
  str_temp+="warning : first model to close to the last model"
278
  nb_of_models_to_gen= len(tags_plus_models[index_tag][2])-index_first_model
279
  str_temp+=f" - only {nb_of_models_to_gen} will be use\n\n"
280
+ str_temp+="list of models use (from "
281
+ str_temp+=f"{index_first_model+1}/{len(tags_plus_models[index_tag][2])} to {index_first_model+nb_of_models_to_gen}/{len(tags_plus_models[index_tag][2])}) :\n\n"
282
  for i in range(nb_of_models_to_gen):
283
+ list_models_temp.append(tags_plus_models[index_tag][2][i+index_first_model])
284
  str_temp+=f"{tags_plus_models[index_tag][2][i+index_first_model]}\n"
285
 
286
+ return nb_of_models_to_gen,gr.Textbox(str_temp),gr.Dropdown(choices=[["",list_models_temp]], value=list_models_temp )
287
 
288
  def make_me():
289
  with gr.Column():
 
333
  index_first_model=gr.Dropdown(label="First model",choices=list(tags_plus_models[1][2]), type="index")
334
  index_tag.change(lambda i:gr.Dropdown(choices=list(tags_plus_models[i][2])),index_tag,index_first_model)
335
  with gr.Row():
336
+ list_models_to_gen=gr.Dropdown(choices=[["",[]]], value=[[]], visible=False)
337
  disp_info=gr.Textbox(label="Info")
338
  load_info=gr.Button("Load info")
339
+ load_info.click(fonc_load_info,[nb_of_models_to_gen,index_tag,index_first_model],[nb_of_models_to_gen,disp_info,list_models_to_gen])
340
 
341
  js_code = """
342