Pamudu13 commited on
Commit
f8a1403
·
verified ·
1 Parent(s): c194fdd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -17,11 +17,11 @@ model_functions = {}
17
  model_idx = 1
18
  for model_path in models:
19
  try:
20
- model_functions[model_idx] = gr.Interface.load(f"models/{model_path}", live=False, preprocess=True, postprocess=False)
21
  except Exception as error:
22
  def the_fn(txt):
23
  return None
24
- model_functions[model_idx] = gr.Interface(fn=the_fn, inputs=gr.inputs.Text(), outputs=gr.outputs.Image())
25
  model_idx += 1
26
 
27
  def send_it_idx(idx):
@@ -59,7 +59,7 @@ with gr.Interface(title="SD Models") as my_interface:
59
  with gr.Column():
60
  with gr.Row():
61
  with gr.Column():
62
- primary_prompt = gr.inputs.Textbox(label="Prompt", default="")
63
  with gr.Column():
64
  run = gr.Button("Run")
65
  clear_btn = gr.Button("Clear")
@@ -68,12 +68,12 @@ with gr.Interface(title="SD Models") as my_interface:
68
  model_idx = 1
69
  for model_path in models:
70
  with gr.Column():
71
- sd_outputs[model_idx] = gr.outputs.Image(label=model_path)
72
  model_idx += 1
73
 
74
- start_box = gr.inputs.Number(visible=False)
75
- end_box = gr.inputs.Number(visible=False)
76
- tog_box = gr.inputs.Textbox(default=0, visible=False)
77
 
78
  def on_change_start_box(value):
79
  return all_task_end(value, end_box.value)
 
17
  model_idx = 1
18
  for model_path in models:
19
  try:
20
+ model_functions[model_idx] = gr.Interface.load(f"models/{model_path}")
21
  except Exception as error:
22
  def the_fn(txt):
23
  return None
24
+ model_functions[model_idx] = gr.Interface(fn=the_fn, inputs=gr.Textbox(), outputs=gr.Image())
25
  model_idx += 1
26
 
27
  def send_it_idx(idx):
 
59
  with gr.Column():
60
  with gr.Row():
61
  with gr.Column():
62
+ primary_prompt = gr.Textbox(label="Prompt", default="")
63
  with gr.Column():
64
  run = gr.Button("Run")
65
  clear_btn = gr.Button("Clear")
 
68
  model_idx = 1
69
  for model_path in models:
70
  with gr.Column():
71
+ sd_outputs[model_idx] = gr.Image(label=model_path)
72
  model_idx += 1
73
 
74
+ start_box = gr.Number(visible=False)
75
+ end_box = gr.Number(visible=False)
76
+ tog_box = gr.Textbox(default=0, visible=False)
77
 
78
  def on_change_start_box(value):
79
  return all_task_end(value, end_box.value)