ccxccc
commited on
Commit
•
769cd11
1
Parent(s):
ebf1949
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ def extend_choices(choices, num_models=6):
|
|
22 |
|
23 |
def update_image_boxes(choices):
|
24 |
extended_choices = extend_choices(choices)
|
25 |
-
return [gr.Image(label=model, visible=(model != 'NA'))
|
26 |
|
27 |
def generate_image(model_name, prompt):
|
28 |
if model_name == 'NA':
|
@@ -32,10 +32,10 @@ def generate_image(model_name, prompt):
|
|
32 |
return models_load[model_name](prompt)
|
33 |
|
34 |
with gr.Blocks() as demo:
|
35 |
-
with gr.Tab("The Dream")
|
36 |
-
txt_input = gr.Textbox(label="Your prompt:", lines=4).style(container=False, min_width=1200
|
37 |
-
gen_button = gr.Button("Generate up to 6 images")
|
38 |
-
stop_button = gr.Button("Stop", variant="secondary")
|
39 |
gen_button.click(lambda _: gr.update(interactive=True), None, stop_button)
|
40 |
|
41 |
with gr.Row():
|
@@ -46,8 +46,8 @@ with gr.Blocks() as demo:
|
|
46 |
gen_event = gen_button.click(generate_image, [model_textbox, txt_input], output_image)
|
47 |
stop_button.click(lambda _: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
|
48 |
|
49 |
-
with gr.Accordion("Model selection")
|
50 |
-
model_choice = gr.CheckboxGroup(choices=models, label=f"Choose up to {num_models} models from the 686 available!", value=default_models, multiselect=True, max_choices=num_models, interactive=True)
|
51 |
model_choice.change(update_image_boxes, model_choice, output_images)
|
52 |
model_choice.change(lambda choices: extend_choices(choices, num_models), model_choice, model_textboxes)
|
53 |
|
@@ -56,7 +56,7 @@ with gr.Blocks() as demo:
|
|
56 |
<div class="footer">
|
57 |
<p>Based on spaces by derwahnsinn, RdnUser77, and the Omnibus Maximum Multiplier!</p>
|
58 |
</div>
|
59 |
-
""")
|
60 |
|
61 |
demo.queue(concurrency_count=200)
|
62 |
demo.launch()
|
|
|
22 |
|
23 |
def update_image_boxes(choices):
|
24 |
extended_choices = extend_choices(choices)
|
25 |
+
return [gr.Image(label=model, visible=(model != 'NA')) for model in extended_choices]
|
26 |
|
27 |
def generate_image(model_name, prompt):
|
28 |
if model_name == 'NA':
|
|
|
32 |
return models_load[model_name](prompt)
|
33 |
|
34 |
with gr.Blocks() as demo:
|
35 |
+
with gr.Tab("The Dream"):
|
36 |
+
txt_input = gr.Textbox(label="Your prompt:", lines=4).style(container=False, min_width=1200)
|
37 |
+
gen_button = gr.Button("Generate up to 6 images")
|
38 |
+
stop_button = gr.Button("Stop", variant="secondary")
|
39 |
gen_button.click(lambda _: gr.update(interactive=True), None, stop_button)
|
40 |
|
41 |
with gr.Row():
|
|
|
46 |
gen_event = gen_button.click(generate_image, [model_textbox, txt_input], output_image)
|
47 |
stop_button.click(lambda _: gr.update(interactive=False), None, stop_button, cancels=[gen_event])
|
48 |
|
49 |
+
with gr.Accordion("Model selection"):
|
50 |
+
model_choice = gr.CheckboxGroup(choices=models, label=f"Choose up to {num_models} models from the 686 available!", value=default_models, multiselect=True, max_choices=num_models, interactive=True)
|
51 |
model_choice.change(update_image_boxes, model_choice, output_images)
|
52 |
model_choice.change(lambda choices: extend_choices(choices, num_models), model_choice, model_textboxes)
|
53 |
|
|
|
56 |
<div class="footer">
|
57 |
<p>Based on spaces by derwahnsinn, RdnUser77, and the Omnibus Maximum Multiplier!</p>
|
58 |
</div>
|
59 |
+
""")
|
60 |
|
61 |
demo.queue(concurrency_count=200)
|
62 |
demo.launch()
|