Uthar commited on
Commit
bb7be99
·
verified ·
1 Parent(s): 184e7dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -90,10 +90,7 @@ async def infer(model_str, prompt, nprompt="", height=0, width=0, steps=0, cfg=0
90
  if task.done() and result is not None and not isinstance(result, tuple):
91
  with lock:
92
  png_path = model_str.replace("/", "_") + " - " + get_current_time() + "_" + str(theSeed) + ".png"
93
- # lnk_output(value=png_path)
94
-
95
  image = save_image(result, png_path, model_str, prompt, nprompt, height, width, steps, cfg, theSeed)
96
- imgageHasUpdated(result)
97
  return image
98
  return None
99
 
@@ -115,6 +112,7 @@ def add_gallery(image, model_str, gallery):
115
  if gallery is None: gallery = []
116
  with lock:
117
  if image is not None: gallery.insert(0, (image, model_str))
 
118
  return gallery
119
 
120
  JS="""
@@ -228,6 +226,7 @@ with gr.Blocks(head=CSS + JS) as demo:
228
  for m, o in zip(current_models, output):
229
  gen_event = gr.on(triggers=[gen_button.click, txt_input.submit], fn=gen_fn,inputs=[m, txt_input, neg_input, height, width, steps, cfg, seed], outputs=[o], concurrency_limit=None, queue=False)
230
  o.change(add_gallery, [o, m, gallery], [gallery])
 
231
 
232
  with gr.Column(scale=4):
233
  with gr.Accordion('Model selection'):
 
90
  if task.done() and result is not None and not isinstance(result, tuple):
91
  with lock:
92
  png_path = model_str.replace("/", "_") + " - " + get_current_time() + "_" + str(theSeed) + ".png"
 
 
93
  image = save_image(result, png_path, model_str, prompt, nprompt, height, width, steps, cfg, theSeed)
 
94
  return image
95
  return None
96
 
 
112
  if gallery is None: gallery = []
113
  with lock:
114
  if image is not None: gallery.insert(0, (image, model_str))
115
+ if image is not None: imgageHasUpdated(image)
116
  return gallery
117
 
118
  JS="""
 
226
  for m, o in zip(current_models, output):
227
  gen_event = gr.on(triggers=[gen_button.click, txt_input.submit], fn=gen_fn,inputs=[m, txt_input, neg_input, height, width, steps, cfg, seed], outputs=[o], concurrency_limit=None, queue=False)
228
  o.change(add_gallery, [o, m, gallery], [gallery])
229
+ # o.change(imgageHasUpdated,[o])
230
 
231
  with gr.Column(scale=4):
232
  with gr.Accordion('Model selection'):