Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -337,7 +337,7 @@ def fonc_load_gallery(id_session,gallery):
|
|
337 |
gallery=add_gallery(cache_image[f"{id_session}"][i],cache_image[f"{id_session}"][i]["model"],gallery)
|
338 |
return gallery
|
339 |
|
340 |
-
def fonc_start(id_session,id_module):
|
341 |
task_actu={}
|
342 |
model_actu=""
|
343 |
print("in fonc\n")
|
@@ -354,8 +354,8 @@ def fonc_start(id_session,id_module):
|
|
354 |
model_actu=model_plus_tasks["model"]
|
355 |
task_actu=model_plus_tasks["task"][0]
|
356 |
if model_actu=="":#crash
|
357 |
-
print("
|
358 |
-
return None,
|
359 |
print("begin gen image\n")
|
360 |
result=gen_fn(model_actu, task_actu["prompt"], task_actu["nprompt"], task_actu["height"], task_actu["width"], task_actu["steps"], task_actu["cfg"], task_actu["seed"])
|
361 |
print("image generate !\n")
|
@@ -379,7 +379,7 @@ def fonc_start(id_session,id_module):
|
|
379 |
for task in model_plus_tasks["task"]:
|
380 |
num_task_undo+=1
|
381 |
print(f"\n {num_task_undo} tasks undo\n")
|
382 |
-
return result
|
383 |
|
384 |
def test_change(s):
|
385 |
if s == "11111":
|
@@ -487,7 +487,7 @@ def make_me():
|
|
487 |
for o,i,s in zip(outputs,id_modules,states):
|
488 |
#o.change(fonc_start,[id_session,i],[o])
|
489 |
#o.change(test_change,[],[])
|
490 |
-
s.change(
|
491 |
#button_start.click(lambda : gr.Image(None),[],[o])
|
492 |
gen_event = gr.on(triggers=[button_start.click], fn=test_start,inputs=[s], outputs=[s])
|
493 |
|
|
|
337 |
gallery=add_gallery(cache_image[f"{id_session}"][i],cache_image[f"{id_session}"][i]["model"],gallery)
|
338 |
return gallery
|
339 |
|
340 |
+
def fonc_start(id_session,id_module,s):
|
341 |
task_actu={}
|
342 |
model_actu=""
|
343 |
print("in fonc\n")
|
|
|
354 |
model_actu=model_plus_tasks["model"]
|
355 |
task_actu=model_plus_tasks["task"][0]
|
356 |
if model_actu=="":#crash
|
357 |
+
print("Stop with :"+s+"\n")
|
358 |
+
return None,gr.Textbox(s)
|
359 |
print("begin gen image\n")
|
360 |
result=gen_fn(model_actu, task_actu["prompt"], task_actu["nprompt"], task_actu["height"], task_actu["width"], task_actu["steps"], task_actu["cfg"], task_actu["seed"])
|
361 |
print("image generate !\n")
|
|
|
379 |
for task in model_plus_tasks["task"]:
|
380 |
num_task_undo+=1
|
381 |
print(f"\n {num_task_undo} tasks undo\n")
|
382 |
+
return result , gr.Textboc(s+"1")
|
383 |
|
384 |
def test_change(s):
|
385 |
if s == "11111":
|
|
|
487 |
for o,i,s in zip(outputs,id_modules,states):
|
488 |
#o.change(fonc_start,[id_session,i],[o])
|
489 |
#o.change(test_change,[],[])
|
490 |
+
s.change(fonc_start,[id_session,i,s],[o,s])
|
491 |
#button_start.click(lambda : gr.Image(None),[],[o])
|
492 |
gen_event = gr.on(triggers=[button_start.click], fn=test_start,inputs=[s], outputs=[s])
|
493 |
|