Spaces:
Running
on
Zero
Running
on
Zero
Update src/app.py
Browse files- src/app.py +2 -41
src/app.py
CHANGED
@@ -21,27 +21,7 @@ from refiners.foundationals.latent_diffusion import Solver, solvers
|
|
21 |
from enhancer import ESRGANUpscaler, ESRGANUpscalerCheckpoints
|
22 |
|
23 |
TITLE = """
|
24 |
-
|
25 |
-
|
26 |
-
<h1 style="font-size: 1.5rem; margin-bottom: 0.5rem;">
|
27 |
-
Image Enhancer Powered By Refiners
|
28 |
-
</h1>
|
29 |
-
|
30 |
-
<div style="display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-bottom: 0.5rem; font-size: 1.25rem; flex-wrap: wrap;">
|
31 |
-
<a href="https://blog.finegrain.ai/posts/reproducing-clarity-upscaler/" target="_blank">[blog post]</a>
|
32 |
-
<a href="https://github.com/finegrain-ai/refiners" target="_blank">[refiners]</a>
|
33 |
-
<a href="https://github.com/philz1337x/clarity-upscaler" target="_blank">[clarity-upscaler]</a>
|
34 |
-
<a href="https://finegrain.ai/" target="_blank">[finegrain]</a>
|
35 |
-
</div>
|
36 |
-
|
37 |
-
<p style="margin: 0;">
|
38 |
-
If you enjoyed this space, please consider starring Refiners on GitHub!
|
39 |
-
<a href="https://github.com/finegrain-ai/refiners" target="_blank">
|
40 |
-
<img src="https://img.shields.io/github/stars/finegrain-ai/refiners?style=social" style="display: inline; vertical-align: middle;" />
|
41 |
-
</a>
|
42 |
-
</p>
|
43 |
-
|
44 |
-
</center>
|
45 |
"""
|
46 |
|
47 |
CHECKPOINTS = ESRGANUpscalerCheckpoints(
|
@@ -162,7 +142,7 @@ def process(
|
|
162 |
# Load the saved PNG image to ensure it is returned in PNG format
|
163 |
enhanced_image_png = Image.open(output_path)
|
164 |
|
165 |
-
return enhanced_image_png
|
166 |
#return enhanced_image
|
167 |
|
168 |
|
@@ -275,23 +255,4 @@ with gr.Blocks() as demo:
|
|
275 |
outputs=output_slider,
|
276 |
)
|
277 |
|
278 |
-
gr.Examples(
|
279 |
-
examples=[
|
280 |
-
"examples/kara-eads-L7EwHkq1B2s-unsplash.jpg",
|
281 |
-
"examples/clarity_bird.webp",
|
282 |
-
"examples/edgar-infocus-gJH8AqpiSEU-unsplash.jpg",
|
283 |
-
"examples/jeremy-wallace-_XjW3oN8UOE-unsplash.jpg",
|
284 |
-
"examples/karina-vorozheeva-rW-I87aPY5Y-unsplash.jpg",
|
285 |
-
"examples/karographix-photography-hIaOPjYCEj4-unsplash.jpg",
|
286 |
-
"examples/melissa-walker-horn-gtDYwUIr9Vg-unsplash.jpg",
|
287 |
-
"examples/ryoji-iwata-X53e51WfjlE-unsplash.jpg",
|
288 |
-
"examples/tadeusz-lakota-jggQZkITXng-unsplash.jpg",
|
289 |
-
],
|
290 |
-
inputs=[input_image],
|
291 |
-
outputs=output_slider,
|
292 |
-
fn=process,
|
293 |
-
cache_examples="lazy",
|
294 |
-
run_on_click=False,
|
295 |
-
)
|
296 |
-
|
297 |
demo.launch(share=False)
|
|
|
21 |
from enhancer import ESRGANUpscaler, ESRGANUpscalerCheckpoints
|
22 |
|
23 |
TITLE = """
|
24 |
+
Image Enhancer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
"""
|
26 |
|
27 |
CHECKPOINTS = ESRGANUpscalerCheckpoints(
|
|
|
142 |
# Load the saved PNG image to ensure it is returned in PNG format
|
143 |
enhanced_image_png = Image.open(output_path)
|
144 |
|
145 |
+
return output_path, enhanced_image_png
|
146 |
#return enhanced_image
|
147 |
|
148 |
|
|
|
255 |
outputs=output_slider,
|
256 |
)
|
257 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
demo.launch(share=False)
|