Spaces:
doevent
/
Running on Zero

ohayonguy commited on
Commit
9c41d8f
·
1 Parent(s): 3bd265f

improved interface

Browse files
Files changed (1) hide show
  1. app.py +17 -2
app.py CHANGED
@@ -126,6 +126,8 @@ def inference(seed, randomize_seed, img, aligned, scale, num_flow_steps):
126
 
127
  if h < 300:
128
  img = cv2.resize(img, (w * 2, h * 2), interpolation=cv2.INTER_LANCZOS4)
 
 
129
 
130
  face_helper = FaceRestoreHelper(
131
  scale,
@@ -150,7 +152,8 @@ def inference(seed, randomize_seed, img, aligned, scale, num_flow_steps):
150
 
151
  output = cv2.cvtColor(output, cv2.COLOR_BGR2RGB)
152
  orig_input = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
153
- orig_input = cv2.resize(orig_input, (output.shape[0], output.shape[1]), interpolation=cv2.INTER_LINEAR)
 
154
  return [[orig_input, output, seed], save_path]
155
 
156
  intro = """
@@ -234,6 +237,18 @@ css = """
234
  margin: 0 auto;
235
  max-width: 512px;
236
  }
 
 
 
 
 
 
 
 
 
 
 
 
237
  """
238
 
239
 
@@ -321,7 +336,7 @@ with gr.Blocks(css=css) as demo:
321
  # ],
322
  # )
323
 
324
-
325
  gr.on(
326
  [run_button.click],
327
  fn=inference,
 
126
 
127
  if h < 300:
128
  img = cv2.resize(img, (w * 2, h * 2), interpolation=cv2.INTER_LANCZOS4)
129
+ h = h * 2
130
+ w = w * 2
131
 
132
  face_helper = FaceRestoreHelper(
133
  scale,
 
152
 
153
  output = cv2.cvtColor(output, cv2.COLOR_BGR2RGB)
154
  orig_input = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
155
+ output = cv2.resize(output, (h, w), interpolation=cv2.INTER_LINEAR)
156
+ orig_input = cv2.resize(orig_input, (h, w), interpolation=cv2.INTER_LINEAR)
157
  return [[orig_input, output, seed], save_path]
158
 
159
  intro = """
 
237
  margin: 0 auto;
238
  max-width: 512px;
239
  }
240
+ #run-button {
241
+ background-color: #FFA500; /* Orange */
242
+ color: white;
243
+ border: none;
244
+ padding: 10px 24px;
245
+ font-size: 16px;
246
+ cursor: pointer;
247
+ border-radius: 8px; /* Optional: Makes the button corners rounded */
248
+ }
249
+ #run-button:hover {
250
+ background-color: #e69500; /* Darker orange on hover */
251
+ }
252
  """
253
 
254
 
 
336
  # ],
337
  # )
338
 
339
+ gr.Markdown(article)
340
  gr.on(
341
  [run_button.click],
342
  fn=inference,