Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,6 @@ nb_mod_dif=20
|
|
23 |
nb_models=nb_mod_dif*nb_rep
|
24 |
|
25 |
cache_image={}
|
26 |
-
cache_image_actu={}
|
27 |
|
28 |
|
29 |
def load_fn(models):
|
@@ -104,7 +103,6 @@ async def infer(model_str, prompt, nprompt="", height=None, width=None, steps=No
|
|
104 |
image = str(Path(png_path).resolve())
|
105 |
return image
|
106 |
return None
|
107 |
-
|
108 |
def gen_fn(model_str, prompt, nprompt="", height=None, width=None, steps=None, cfg=None, seed=-1):
|
109 |
if model_str == 'NA':
|
110 |
return None
|
@@ -394,6 +392,31 @@ def make_me():
|
|
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 = """
|
398 |
|
399 |
console.log('ghgh');
|
|
|
23 |
nb_models=nb_mod_dif*nb_rep
|
24 |
|
25 |
cache_image={}
|
|
|
26 |
|
27 |
|
28 |
def load_fn(models):
|
|
|
103 |
image = str(Path(png_path).resolve())
|
104 |
return image
|
105 |
return None
|
|
|
106 |
def gen_fn(model_str, prompt, nprompt="", height=None, width=None, steps=None, cfg=None, seed=-1):
|
107 |
if model_str == 'NA':
|
108 |
return None
|
|
|
392 |
load_model_custom=gr.Button("Load Models Custom")
|
393 |
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])
|
394 |
|
395 |
+
with gr.Column():
|
396 |
+
with gr.Row():
|
397 |
+
id_session=gr.Number(visible=False,value=0)
|
398 |
+
nb_req_simult=gr.Number(50,"Number simultaneous request")
|
399 |
+
nb_req_simult_max_by_mod=gr.Number(2,"Number max simultaneous request by model")
|
400 |
+
|
401 |
+
with gr.Row():
|
402 |
+
outputs=[]
|
403 |
+
for i in len(nb_req_simult):
|
404 |
+
outputs.append(gr.Image(None,interactive=False,render=False))
|
405 |
+
|
406 |
+
|
407 |
+
|
408 |
+
|
409 |
+
|
410 |
+
|
411 |
+
|
412 |
+
|
413 |
+
|
414 |
+
|
415 |
+
|
416 |
+
|
417 |
+
gen_button.click(set_session, id_session, id_session)
|
418 |
+
|
419 |
+
|
420 |
js_code = """
|
421 |
|
422 |
console.log('ghgh');
|