Spaces:
Running
on
Zero
Running
on
Zero
ohayonguy
commited on
Commit
•
81ba96a
1
Parent(s):
b1e0e58
improved interface
Browse files
app.py
CHANGED
@@ -148,9 +148,9 @@ def enhance_face(img, face_helper, has_aligned, num_flow_steps, scale=2):
|
|
148 |
@torch.inference_mode()
|
149 |
@spaces.GPU()
|
150 |
def inference(
|
|
|
151 |
seed,
|
152 |
randomize_seed,
|
153 |
-
img,
|
154 |
aligned,
|
155 |
scale,
|
156 |
num_flow_steps,
|
@@ -250,16 +250,9 @@ demo = gr.Interface(
|
|
250 |
inference,
|
251 |
[
|
252 |
gr.Image(label="Input", type="filepath", show_label=True),
|
|
|
253 |
gr.Checkbox(label="Randomize seed", value=True),
|
254 |
gr.Checkbox(label="The input is an aligned face image", value=False),
|
255 |
-
gr.Slider(
|
256 |
-
label="Number of Inference Steps",
|
257 |
-
minimum=1,
|
258 |
-
maximum=200,
|
259 |
-
step=1,
|
260 |
-
value=25,
|
261 |
-
scale=1,
|
262 |
-
),
|
263 |
gr.Slider(
|
264 |
label="Scale factor (applicable to non-aligned face images)",
|
265 |
minimum=1,
|
@@ -268,7 +261,14 @@ demo = gr.Interface(
|
|
268 |
value=1,
|
269 |
scale=1,
|
270 |
),
|
271 |
-
gr.Slider(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
],
|
273 |
[
|
274 |
gr.Image(label="Output", type="numpy", show_label=True, format="png"),
|
|
|
148 |
@torch.inference_mode()
|
149 |
@spaces.GPU()
|
150 |
def inference(
|
151 |
+
img,
|
152 |
seed,
|
153 |
randomize_seed,
|
|
|
154 |
aligned,
|
155 |
scale,
|
156 |
num_flow_steps,
|
|
|
250 |
inference,
|
251 |
[
|
252 |
gr.Image(label="Input", type="filepath", show_label=True),
|
253 |
+
gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=42, scale=1),
|
254 |
gr.Checkbox(label="Randomize seed", value=True),
|
255 |
gr.Checkbox(label="The input is an aligned face image", value=False),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
gr.Slider(
|
257 |
label="Scale factor (applicable to non-aligned face images)",
|
258 |
minimum=1,
|
|
|
261 |
value=1,
|
262 |
scale=1,
|
263 |
),
|
264 |
+
gr.Slider(
|
265 |
+
label="Number of Inference Steps",
|
266 |
+
minimum=1,
|
267 |
+
maximum=200,
|
268 |
+
step=1,
|
269 |
+
value=25,
|
270 |
+
scale=1,
|
271 |
+
),
|
272 |
],
|
273 |
[
|
274 |
gr.Image(label="Output", type="numpy", show_label=True, format="png"),
|