Update app.py
Browse files
app.py
CHANGED
|
@@ -62,28 +62,6 @@ with gr.Blocks() as demo:
|
|
| 62 |
for m, o in zip(current_models, output):
|
| 63 |
gen_event = gen_button.click(gen_fn, [m, txt_input], o)
|
| 64 |
stop_button.click(lambda s: gr.update(interactive = False), None, stop_button, cancels = [gen_event])
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
with gr.Tab('Single model'):
|
| 68 |
-
model_choice2 = gr.Dropdown(models, label = 'Choose model', value = models[0], filterable = False)
|
| 69 |
-
txt_input2 = gr.Textbox(label = 'Prompt text')
|
| 70 |
-
|
| 71 |
-
max_images = 6
|
| 72 |
-
num_images = gr.Slider(1, max_images, value = max_images, step = 1, label = 'Number of images')
|
| 73 |
-
|
| 74 |
-
gen_button2 = gr.Button('Generate')
|
| 75 |
-
stop_button2 = gr.Button('Stop', variant = 'secondary', interactive = False)
|
| 76 |
-
gen_button2.click(lambda s: gr.update(interactive = True), None, stop_button2)
|
| 77 |
-
|
| 78 |
-
with gr.Row():
|
| 79 |
-
output2 = [gr.Image(label = '') for _ in range(max_images)]
|
| 80 |
|
| 81 |
-
for i, o in enumerate(output2):
|
| 82 |
-
img_i = gr.Number(i, visible = False)
|
| 83 |
-
num_images.change(lambda i, n: gr.update(visible = (i < n)), [img_i, num_images], o)
|
| 84 |
-
gen_event2 = gen_button2.click(lambda i, n, m, t: gen_fn(m, t) if (i < n) else None, [img_i, num_images, model_choice2, txt_input2], o)
|
| 85 |
-
stop_button2.click(lambda s: gr.update(interactive = False), None, stop_button2, cancels = [gen_event2])
|
| 86 |
-
|
| 87 |
-
|
| 88 |
demo.queue(concurrency_count = 200)
|
| 89 |
demo.launch()
|
|
|
|
| 62 |
for m, o in zip(current_models, output):
|
| 63 |
gen_event = gen_button.click(gen_fn, [m, txt_input], o)
|
| 64 |
stop_button.click(lambda s: gr.update(interactive = False), None, stop_button, cancels = [gen_event])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
demo.queue(concurrency_count = 200)
|
| 67 |
demo.launch()
|