Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -413,6 +413,11 @@ def index_gallery_next(i,list_models):
|
|
413 |
def index_gallery_prev(i,list_models):
|
414 |
iT=i-1
|
415 |
return gr.Number(iT%len(list_models))
|
|
|
|
|
|
|
|
|
|
|
416 |
|
417 |
def make_me():
|
418 |
with gr.Column():
|
@@ -524,25 +529,30 @@ def make_me():
|
|
524 |
button_load_gallery=gr.Button("Load Gallery All")
|
525 |
button_load_gallery.click(fonc_load_gallery,[id_session,gallery],[gallery])
|
526 |
|
527 |
-
index_gallery=gr.Number(
|
528 |
button_load_gallery_first=gr.Button("Load Gallery first model")
|
529 |
button_load_gallery_first.click(index_gallery_first,[],[index_gallery])
|
530 |
with gr.Row():
|
|
|
531 |
button_load_gallery_next=gr.Button("Next model")
|
532 |
button_load_gallery_next.click(index_gallery_next,[index_gallery,list_models_to_gen],[index_gallery])
|
533 |
-
button_load_gallery_prev=gr.Button("Prev model")
|
534 |
button_load_gallery_prev.click(index_gallery_prev,[index_gallery,list_models_to_gen],[index_gallery])
|
535 |
index_gallery.change(fonc_load_gallery_by_model,[id_session,gallery,list_models_to_gen,index_gallery],[gallery])
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
542 |
|
543 |
|
544 |
-
|
545 |
-
#gen_button.click(set_session, id_session, id_session)
|
546 |
|
547 |
|
548 |
js_code = """
|
|
|
413 |
def index_gallery_prev(i,list_models):
|
414 |
iT=i-1
|
415 |
return gr.Number(iT%len(list_models))
|
416 |
+
|
417 |
+
def change_text_model_actu_gal(list_models,index):
|
418 |
+
return gr.Textbox(f"{list_models[index]}")
|
419 |
+
def fonc_add_to_text(text,list_models,index):
|
420 |
+
return gr.Textbox(f"\"{list_models[index]}\",\n")
|
421 |
|
422 |
def make_me():
|
423 |
with gr.Column():
|
|
|
529 |
button_load_gallery=gr.Button("Load Gallery All")
|
530 |
button_load_gallery.click(fonc_load_gallery,[id_session,gallery],[gallery])
|
531 |
|
532 |
+
index_gallery=gr.Number(-1,visible=False)
|
533 |
button_load_gallery_first=gr.Button("Load Gallery first model")
|
534 |
button_load_gallery_first.click(index_gallery_first,[],[index_gallery])
|
535 |
with gr.Row():
|
536 |
+
button_load_gallery_prev=gr.Button("Prev model")
|
537 |
button_load_gallery_next=gr.Button("Next model")
|
538 |
button_load_gallery_next.click(index_gallery_next,[index_gallery,list_models_to_gen],[index_gallery])
|
|
|
539 |
button_load_gallery_prev.click(index_gallery_prev,[index_gallery,list_models_to_gen],[index_gallery])
|
540 |
index_gallery.change(fonc_load_gallery_by_model,[id_session,gallery,list_models_to_gen,index_gallery],[gallery])
|
541 |
+
text_model_actu_gal = gr.Textbox(label='Model Actu:', lines=1, interactive = False)
|
542 |
+
index_gallery.change(change_text_model_actu_gal,[list_models_to_gen,index_gallery],[text_model_actu_gal])
|
543 |
+
with gr.Row():
|
544 |
+
with gr.Column():
|
545 |
+
button_add_to_bl=gr.Button("Add to Blacklist")
|
546 |
+
#button_remove_from_bl=gr.Button("Remove from Blacklist")
|
547 |
+
text_bl=gr.Textbox(label='Blacklist', lines=5, interactive = True)
|
548 |
+
button_add_to_bl.click(fonc_add_to_text,[text_bl,list_models_to_gen,index_gallery],[text_bl])
|
549 |
+
#button_remove_from_bl.click(fonc_remove_from_text,[text_bl,list_models_to_gen,index_gallery],[text_bl])
|
550 |
+
with gr.Column():
|
551 |
+
button_add_to_fav=gr.Button("Add to Favlist")
|
552 |
+
text_fav=gr.Textbox(label='Favlist', lines=5, interactive = True)
|
553 |
+
button_add_to_bl.click(fonc_add_to_text,[text_fav,list_models_to_gen,index_gallery],[text_fav])
|
554 |
|
555 |
|
|
|
|
|
556 |
|
557 |
|
558 |
js_code = """
|