Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -44,7 +44,7 @@ def gen_fn(model_str, prompt):
|
|
44 |
|
45 |
with gr.Blocks() as demo:
|
46 |
with gr.Tab('The Dream'):
|
47 |
-
model_choice2 = gr.Dropdown(models, label = 'Choose model from the 686 available!', value = models[0], filterable = False)
|
48 |
txt_input2 = gr.Textbox(label = 'Your prompt:')
|
49 |
|
50 |
max_images = 6
|
@@ -68,8 +68,9 @@ with gr.Blocks() as demo:
|
|
68 |
|
69 |
with gr.Column():
|
70 |
num_images = gr.Slider(1, max_images, value = 1, step = 1, label = 'Number of images')
|
71 |
-
output2 = [gr.Image(label = '') for _ in range(
|
72 |
for i, o in enumerate(output2):
|
|
|
73 |
img_i = gr.Number(i, visible = False)
|
74 |
num_images.change(lambda i, n: gr.update(visible = (i < n)), [img_i, num_images], o, show_progress = False)
|
75 |
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)
|
|
|
44 |
|
45 |
with gr.Blocks() as demo:
|
46 |
with gr.Tab('The Dream'):
|
47 |
+
model_choice2 = gr.Dropdown(models, label = 'Choose a model from the 686 available!', value = models[0], filterable = False)
|
48 |
txt_input2 = gr.Textbox(label = 'Your prompt:')
|
49 |
|
50 |
max_images = 6
|
|
|
68 |
|
69 |
with gr.Column():
|
70 |
num_images = gr.Slider(1, max_images, value = 1, step = 1, label = 'Number of images')
|
71 |
+
output2 = [gr.Image(label = '') for _ in range(num_models)]
|
72 |
for i, o in enumerate(output2):
|
73 |
+
num_models = num_images
|
74 |
img_i = gr.Number(i, visible = False)
|
75 |
num_images.change(lambda i, n: gr.update(visible = (i < n)), [img_i, num_images], o, show_progress = False)
|
76 |
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)
|