Spaces:
Runtime error
Runtime error
Al Duffy
commited on
Commit
·
c759728
1
Parent(s):
73dc56f
Update app.py
Browse files
app.py
CHANGED
@@ -26,6 +26,10 @@ def read_main():
|
|
26 |
def realesrgan(img, model_name, denoise_strength, face_enhance, outscale):
|
27 |
"""Real-ESRGAN function to restore (and upscale) images.
|
28 |
"""
|
|
|
|
|
|
|
|
|
29 |
if not img:
|
30 |
return
|
31 |
|
@@ -193,14 +197,15 @@ def main():
|
|
193 |
|
194 |
with gr.Accordion("Options/Parameters"):
|
195 |
with gr.Row():
|
196 |
-
model_name = "
|
|
|
197 |
denoise_strength = gr.Slider(label="Denoise Strength (Used only with the realesr-general-x4v3 model)",
|
198 |
minimum=0, maximum=1, step=0.1, value=0.5)
|
199 |
outscale = gr.Slider(label="Image Upscaling Factor",
|
200 |
minimum=1, maximum=10, step=1, value=2, show_label=True)
|
201 |
face_enhance = gr.Checkbox(label="Face Enhancement using GFPGAN (Doesn't work for anime images)",
|
202 |
value=False, show_label=True)
|
203 |
-
|
204 |
with gr.Row():
|
205 |
with gr.Group():
|
206 |
input_image = gr.Image(label="Source Image", type="pil", image_mode="RGBA")
|
|
|
26 |
def realesrgan(img, model_name, denoise_strength, face_enhance, outscale):
|
27 |
"""Real-ESRGAN function to restore (and upscale) images.
|
28 |
"""
|
29 |
+
choices=["RealESRGAN_x4plus", "RealESRNet_x4plus", "RealESRGAN_x4plus_anime_6B",
|
30 |
+
"RealESRGAN_x2plus", "realesr-general-x4v3"]
|
31 |
+
model_name = choices[model_name]
|
32 |
+
model_name = choices[model_name]
|
33 |
if not img:
|
34 |
return
|
35 |
|
|
|
197 |
|
198 |
with gr.Accordion("Options/Parameters"):
|
199 |
with gr.Row():
|
200 |
+
model_name = gr.Slider(label="Model to use",
|
201 |
+
minimum=0, maximum=4, step=1, value=4)
|
202 |
denoise_strength = gr.Slider(label="Denoise Strength (Used only with the realesr-general-x4v3 model)",
|
203 |
minimum=0, maximum=1, step=0.1, value=0.5)
|
204 |
outscale = gr.Slider(label="Image Upscaling Factor",
|
205 |
minimum=1, maximum=10, step=1, value=2, show_label=True)
|
206 |
face_enhance = gr.Checkbox(label="Face Enhancement using GFPGAN (Doesn't work for anime images)",
|
207 |
value=False, show_label=True)
|
208 |
+
|
209 |
with gr.Row():
|
210 |
with gr.Group():
|
211 |
input_image = gr.Image(label="Source Image", type="pil", image_mode="RGBA")
|