Yntec commited on
Commit
17c773f
·
verified ·
1 Parent(s): b6e88d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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(max_images)]
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)