Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -55,8 +55,7 @@ load_fn(models)
|
|
| 55 |
tags_plus_models_to_list=[]
|
| 56 |
list_tags=[]
|
| 57 |
for tag_plus_m in tags_plus_models:
|
| 58 |
-
|
| 59 |
-
list_tags.append(tag_plus_m[0])
|
| 60 |
|
| 61 |
def test_pass(test):
|
| 62 |
if test==os.getenv('p'):
|
|
@@ -326,19 +325,16 @@ def make_me():
|
|
| 326 |
with gr.Row():
|
| 327 |
nb_images_by_prompt=gr.Number(2,label="Number of images by prompt:",interactive=True)
|
| 328 |
nb_of_models_to_gen=gr.Number(10,label="Number of Models:",interactive=True)
|
| 329 |
-
#list_models_in_tag=gr.Dropdown(label="Tag",choices=list(tags_plus_models_to_list),value=tags_plus_models_to_list[1][1])
|
| 330 |
-
#index_first_model=gr.Dropdown(label="First model",choices=tags_plus_models_to_list[1][1], type="index")
|
| 331 |
-
#list_models_in_tag.change(lambda x:gr.Dropdown(choices=x),list_models_in_tag,index_first_model)
|
| 332 |
index_tag=gr.Dropdown(label="Tag",choices=list(list_tags),type="index")
|
| 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 |
-
load_info=gr.Button("Test")
|
| 341 |
-
load_info.click(lambda x:print(x),list_param,[])
|
| 342 |
|
| 343 |
js_code = """
|
| 344 |
|
|
|
|
| 55 |
tags_plus_models_to_list=[]
|
| 56 |
list_tags=[]
|
| 57 |
for tag_plus_m in tags_plus_models:
|
| 58 |
+
list_tags.append(tag_plus_m[0]+f" ({tag_plus_m[1]})")
|
|
|
|
| 59 |
|
| 60 |
def test_pass(test):
|
| 61 |
if test==os.getenv('p'):
|
|
|
|
| 325 |
with gr.Row():
|
| 326 |
nb_images_by_prompt=gr.Number(2,label="Number of images by prompt:",interactive=True)
|
| 327 |
nb_of_models_to_gen=gr.Number(10,label="Number of Models:",interactive=True)
|
|
|
|
|
|
|
|
|
|
| 328 |
index_tag=gr.Dropdown(label="Tag",choices=list(list_tags),type="index")
|
| 329 |
index_first_model=gr.Dropdown(label="First model",choices=list(tags_plus_models[1][2]), type="index")
|
| 330 |
+
#index_tag.change(lambda i:gr.Dropdown(choices=list(tags_plus_models[i][2])),index_tag,index_first_model)
|
| 331 |
+
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]))])),
|
| 332 |
+
index_tag,index_first_model)
|
| 333 |
with gr.Row():
|
| 334 |
list_models_to_gen=gr.Dropdown(choices=[["",[]]], value=[], visible=False)
|
| 335 |
disp_info=gr.Textbox(label="Info")
|
| 336 |
load_info=gr.Button("Load info")
|
| 337 |
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])
|
|
|
|
|
|
|
| 338 |
|
| 339 |
js_code = """
|
| 340 |
|