Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -292,7 +292,7 @@ def fonc_load_info_custom(nb_of_models_to_gen,list_model_custom,index_first_mode
|
|
292 |
str_temp+="warning : first model to close to the last model"
|
293 |
nb_of_models_to_gen= len(list_model_custom)-index_first_model
|
294 |
str_temp+=f" - only {nb_of_models_to_gen} will be use\n\n"
|
295 |
-
str_temp+="list of models use (from "
|
296 |
str_temp+=f"{index_first_model+1}/{len(list_model_custom)} to {index_first_model+nb_of_models_to_gen}/{len(list_model_custom)}) :\n\n"
|
297 |
for i in range(nb_of_models_to_gen):
|
298 |
list_models_temp.append(list_model_custom[i+index_first_model])
|
@@ -364,18 +364,19 @@ def make_me():
|
|
364 |
add_param.click(fonc_add_param,[list_param,txt_input,neg_input,width,height,steps,cfg,seed],[disp_param.dataset,list_param])
|
365 |
del_param.click(fonc_del_param,[list_param,txt_input,neg_input,width,height,steps,cfg,seed],[disp_param.dataset,list_param])
|
366 |
|
367 |
-
with gr.Row():
|
368 |
-
nb_images_by_prompt=gr.Number(2,label="Number of images by prompt:",interactive=True)
|
369 |
-
nb_of_models_to_gen=gr.Number(10,label="Number of Models:",interactive=True)
|
370 |
-
index_tag=gr.Dropdown(label="Tag",choices=list(list_tags),type="index")
|
371 |
-
index_first_model=gr.Dropdown(label="First model",choices=list([]), type="index")
|
372 |
-
index_tag.change(lambda i:gr.Dropdown(choices=list([f"({j+1}/{len(tags_plus_models[i][2])}) {tags_plus_models[i][2][j]}" for j in range(len(tags_plus_models[i][2]))])),
|
373 |
-
index_tag,index_first_model)
|
374 |
with gr.Row():
|
375 |
list_models_to_gen=gr.Dropdown(choices=[["",[]]], value=[], visible=False)
|
376 |
disp_info=gr.Textbox(label="Info")
|
377 |
-
|
378 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
379 |
|
380 |
with gr.Accordion("Models Custom",open=False) :
|
381 |
with gr.Row():
|
@@ -390,7 +391,7 @@ def make_me():
|
|
390 |
list_model_custom.change(lambda li:gr.Dropdown(choices=list([f"({j+1}/{len(li)}) {li[j]}" for j in range(len(li))])),
|
391 |
[list_model_custom],index_first_model_custom)
|
392 |
|
393 |
-
load_model_custom=gr.Button("Load
|
394 |
load_model_custom.click(fonc_load_info_custom,[nb_of_models_to_gen,list_model_custom,index_first_model_custom],[nb_of_models_to_gen,disp_info,list_models_to_gen])
|
395 |
|
396 |
js_code = """
|
|
|
292 |
str_temp+="warning : first model to close to the last model"
|
293 |
nb_of_models_to_gen= len(list_model_custom)-index_first_model
|
294 |
str_temp+=f" - only {nb_of_models_to_gen} will be use\n\n"
|
295 |
+
str_temp+="list of models CUSTOM use (from "
|
296 |
str_temp+=f"{index_first_model+1}/{len(list_model_custom)} to {index_first_model+nb_of_models_to_gen}/{len(list_model_custom)}) :\n\n"
|
297 |
for i in range(nb_of_models_to_gen):
|
298 |
list_models_temp.append(list_model_custom[i+index_first_model])
|
|
|
364 |
add_param.click(fonc_add_param,[list_param,txt_input,neg_input,width,height,steps,cfg,seed],[disp_param.dataset,list_param])
|
365 |
del_param.click(fonc_del_param,[list_param,txt_input,neg_input,width,height,steps,cfg,seed],[disp_param.dataset,list_param])
|
366 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
367 |
with gr.Row():
|
368 |
list_models_to_gen=gr.Dropdown(choices=[["",[]]], value=[], visible=False)
|
369 |
disp_info=gr.Textbox(label="Info")
|
370 |
+
with gr.Column():
|
371 |
+
with gr.Row():
|
372 |
+
nb_images_by_prompt=gr.Number(2,label="Number of images by prompt:",interactive=True)
|
373 |
+
nb_of_models_to_gen=gr.Number(10,label="Number of Models:",interactive=True)
|
374 |
+
index_tag=gr.Dropdown(label="Tag",choices=list(list_tags),type="index")
|
375 |
+
index_first_model=gr.Dropdown(label="First model",choices=list([]), type="index")
|
376 |
+
index_tag.change(lambda i:gr.Dropdown(choices=list([f"({j+1}/{len(tags_plus_models[i][2])}) {tags_plus_models[i][2][j]}" for j in range(len(tags_plus_models[i][2]))])),
|
377 |
+
index_tag,index_first_model)
|
378 |
+
load_info=gr.Button("Load Models")
|
379 |
+
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])
|
380 |
|
381 |
with gr.Accordion("Models Custom",open=False) :
|
382 |
with gr.Row():
|
|
|
391 |
list_model_custom.change(lambda li:gr.Dropdown(choices=list([f"({j+1}/{len(li)}) {li[j]}" for j in range(len(li))])),
|
392 |
[list_model_custom],index_first_model_custom)
|
393 |
|
394 |
+
load_model_custom=gr.Button("Load Models Custom")
|
395 |
load_model_custom.click(fonc_load_info_custom,[nb_of_models_to_gen,list_model_custom,index_first_model_custom],[nb_of_models_to_gen,disp_info,list_models_to_gen])
|
396 |
|
397 |
js_code = """
|