charliebaby2023 commited on
Commit
0cfd87f
·
verified ·
1 Parent(s): cd37c13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -11
app.py CHANGED
@@ -107,11 +107,6 @@ def gen_fn(model_str, prompt, nprompt="", height=0, width=0, steps=0, cfg=0, see
107
  return result
108
 
109
 
110
- def add_gallery(image, model_str, gallery):
111
- if gallery is None: gallery = []
112
- with lock:
113
- if image is not None: gallery.insert(0, (image, model_str))
114
- return gallery
115
 
116
  with gr.Blocks(fill_width=True) as demo:
117
  with gr.Tab(str(num_models) + ' Models'):
@@ -141,16 +136,11 @@ with gr.Blocks(fill_width=True) as demo:
141
  visible=True) for m in default_models]
142
  current_models = [gr.Textbox(m, visible=False) for m in default_models]
143
 
144
- with gr.Column(scale=2):
145
- gallery = gr.Gallery(label="Output", show_download_button=True,
146
- interactive=False, show_share_button=False, container=True, format="png",
147
- preview=True, object_fit="cover", columns=2, rows=2)
148
-
149
  for m, o in zip(current_models, output):
150
  gen_event = gr.on(triggers=[gen_button.click, txt_input.submit], fn=gen_fn,
151
  inputs=[m, txt_input, neg_input, height, width, steps, cfg, seed], outputs=[o],
152
  concurrency_limit=None, queue=False)
153
- o.change(add_gallery, [o, m, gallery], [gallery])
154
 
155
  with gr.Column(scale=4):
156
  with gr.Accordion('Model selection'):
 
107
  return result
108
 
109
 
 
 
 
 
 
110
 
111
  with gr.Blocks(fill_width=True) as demo:
112
  with gr.Tab(str(num_models) + ' Models'):
 
136
  visible=True) for m in default_models]
137
  current_models = [gr.Textbox(m, visible=False) for m in default_models]
138
 
 
 
 
 
 
139
  for m, o in zip(current_models, output):
140
  gen_event = gr.on(triggers=[gen_button.click, txt_input.submit], fn=gen_fn,
141
  inputs=[m, txt_input, neg_input, height, width, steps, cfg, seed], outputs=[o],
142
  concurrency_limit=None, queue=False)
143
+
144
 
145
  with gr.Column(scale=4):
146
  with gr.Accordion('Model selection'):