Spaces:
Runtime error
Runtime error
Update appTest1.py
Browse files- appTest1.py +29 -1
appTest1.py
CHANGED
|
@@ -3,7 +3,7 @@ import gradio as gr
|
|
| 3 |
from random import randint
|
| 4 |
from operator import itemgetter
|
| 5 |
import bisect
|
| 6 |
-
from
|
| 7 |
from datetime import datetime
|
| 8 |
from externalmod import gr_Interface_load
|
| 9 |
import asyncio
|
|
@@ -445,6 +445,24 @@ def find_index_tag(group_tag_choice):
|
|
| 445 |
return gr.Number(i)
|
| 446 |
return gr.Number(0)
|
| 447 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 448 |
def ratio_chosen(choice_ratio,width,height):
|
| 449 |
if choice_ratio == [None,None]:
|
| 450 |
return width , height
|
|
@@ -553,6 +571,16 @@ def make_me():
|
|
| 553 |
button_rand_from_tag_all_models=gr.Button("Random all models from tag")
|
| 554 |
button_rand_from_all_all_models=gr.Button("Random all models from all")
|
| 555 |
button_rand_from_fav_all_models=gr.Button("Random all models from fav")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 556 |
|
| 557 |
|
| 558 |
with gr.Accordion("Gallery",open=False):
|
|
|
|
| 3 |
from random import randint
|
| 4 |
from operator import itemgetter
|
| 5 |
import bisect
|
| 6 |
+
from all_models2 import tags_plus_models,models,models_plus_tags
|
| 7 |
from datetime import datetime
|
| 8 |
from externalmod import gr_Interface_load
|
| 9 |
import asyncio
|
|
|
|
| 445 |
return gr.Number(i)
|
| 446 |
return gr.Number(0)
|
| 447 |
|
| 448 |
+
|
| 449 |
+
def fonc_search_warm_models(tag,b_format):
|
| 450 |
+
if tag == "":
|
| 451 |
+
tagT=["stable-diffusion-xl"]
|
| 452 |
+
else:
|
| 453 |
+
tagT=["stable-diffusion-xl",tag]
|
| 454 |
+
models_temp , models_plus_tags_temp = find_warm_model_list("John6666", tagT, "", "last_modified", 10000)
|
| 455 |
+
s=""
|
| 456 |
+
if b_format:
|
| 457 |
+
rep=nb_rep
|
| 458 |
+
else:
|
| 459 |
+
rep=1
|
| 460 |
+
for m in models_temp:
|
| 461 |
+
if m in models:
|
| 462 |
+
for i in range(rep):
|
| 463 |
+
s+=f"\"{m}\",\n"
|
| 464 |
+
return gr.Textbox(s)
|
| 465 |
+
|
| 466 |
def ratio_chosen(choice_ratio,width,height):
|
| 467 |
if choice_ratio == [None,None]:
|
| 468 |
return width , height
|
|
|
|
| 571 |
button_rand_from_tag_all_models=gr.Button("Random all models from tag")
|
| 572 |
button_rand_from_all_all_models=gr.Button("Random all models from all")
|
| 573 |
button_rand_from_fav_all_models=gr.Button("Random all models from fav")
|
| 574 |
+
|
| 575 |
+
|
| 576 |
+
with gr.Accordion("Warm models",open=False):
|
| 577 |
+
with gr.Row():
|
| 578 |
+
text_warm_models=gr.Textbox("",label="list of warm model")
|
| 579 |
+
with gr.Column():
|
| 580 |
+
text_tag_warm_models=gr.Textbox(lines=1)
|
| 581 |
+
bool_format_models=gr.Checkbox(label="Format list",value=False)
|
| 582 |
+
button_search_warm_models=gr.Button("search warm models")
|
| 583 |
+
button_search_warm_models.click(fonc_search_warm_models,[text_tag_warm_models,bool_format_models],[text_warm_models])
|
| 584 |
|
| 585 |
|
| 586 |
with gr.Accordion("Gallery",open=False):
|