derwahnsinn commited on
Commit
8fd30e2
1 Parent(s): cc23ea5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -31,24 +31,23 @@ def update_imgbox(choices):
31
  return [gr.Image(None, label = m, visible = (m != 'NA')) for m in choices_plus]
32
 
33
 
34
- def gen_fn(model_str, prompt, negative_prompt=None):
35
  if model_str == 'NA':
36
  return None
37
  noise = str(randint(0, 99999999999))
38
- return models_load[model_str](f'{prompt}', negative_prompt=negative_prompt)
39
 
40
 
41
  with gr.Blocks() as demo:
42
  with gr.Tab('Multiple models'):
43
  with gr.Accordion('Model selection'):
44
- # ... accordion content here
45
 
46
- txt_input = gr.Textbox(label='Positive Prompt text')
47
- neg_txt_input = gr.Textbox(label='Negative Prompt (optional)', placeholder="e.g., no cars")
48
 
49
- gen_button = gr.Button('Generate')
50
- stop_button = gr.Button('Stop', variant = 'secondary', interactive = False)
51
- gen_button.click(lambda s: gr.update(interactive = True), None, stop_button)
 
52
 
53
  with gr.Row():
54
  output = [gr.Image(label = m) for m in default_models]
 
31
  return [gr.Image(None, label = m, visible = (m != 'NA')) for m in choices_plus]
32
 
33
 
34
+ def gen_fn(model_str, prompt):
35
  if model_str == 'NA':
36
  return None
37
  noise = str(randint(0, 99999999999))
38
+ return models_load[model_str](f'{prompt} {noise}')
39
 
40
 
41
  with gr.Blocks() as demo:
42
  with gr.Tab('Multiple models'):
43
  with gr.Accordion('Model selection'):
44
+ model_choice = gr.CheckboxGroup(models, label = f'Choose up to {num_models} different models', value = default_models, multiselect = True, max_choices = num_models, interactive = True, filterable = False)
45
 
 
 
46
 
47
+ txt_input = gr.Textbox(label = 'Prompt text')
48
+ gen_button = gr.Button('Generate')
49
+ stop_button = gr.Button('Stop', variant = 'secondary', interactive = False)
50
+ gen_button.click(lambda s: gr.update(interactive = True), None, stop_button)
51
 
52
  with gr.Row():
53
  output = [gr.Image(label = m) for m in default_models]