Spaces:
Build error
Build error
Update src/app.py
Browse files- src/app.py +4 -10
src/app.py
CHANGED
@@ -16,7 +16,6 @@ pillow_heif.register_heif_opener()
|
|
16 |
|
17 |
TITLE = """
|
18 |
<center>
|
19 |
-
|
20 |
<div style="
|
21 |
background-color: #ff9100;
|
22 |
color: #1f2937;
|
@@ -26,24 +25,19 @@ TITLE = """
|
|
26 |
🚀 NEW: all the Finegrain spaces are now reunited under the
|
27 |
<a href="https://editor.finegrain.ai/signup?utm_source=hf&utm_campaign=image-enhancer" target="_blank">Finegrain Editor</a>. Give it a shot! 🚀
|
28 |
</div>
|
29 |
-
|
30 |
<h1 style="font-size: 1.5rem; margin-bottom: 0.5rem;">
|
31 |
Image Enhancer Powered By Refiners
|
32 |
</h1>
|
33 |
-
|
34 |
<p>
|
35 |
Turn low resolution images into high resolution versions with added generated details (your image will be modified).
|
36 |
</p>
|
37 |
-
|
38 |
<p>
|
39 |
This space is powered by Refiners, our open source micro-framework for simple foundation model adaptation.
|
40 |
If you enjoyed it, please consider starring Refiners on GitHub!
|
41 |
</p>
|
42 |
-
|
43 |
<a href="https://github.com/finegrain-ai/refiners" target="_blank">
|
44 |
<img src="https://img.shields.io/github/stars/finegrain-ai/refiners?style=social" />
|
45 |
</a>
|
46 |
-
|
47 |
</center>
|
48 |
"""
|
49 |
|
@@ -134,7 +128,7 @@ def process(
|
|
134 |
denoise_strength: float = 0.35,
|
135 |
num_inference_steps: int = 18,
|
136 |
solver: str = "DDIM",
|
137 |
-
) ->
|
138 |
manual_seed(seed)
|
139 |
|
140 |
solver_type: type[Solver] = getattr(solvers, solver)
|
@@ -154,7 +148,7 @@ def process(
|
|
154 |
solver_type=solver_type,
|
155 |
)
|
156 |
|
157 |
-
return
|
158 |
|
159 |
|
160 |
with gr.Blocks() as demo:
|
@@ -263,7 +257,7 @@ with gr.Blocks() as demo:
|
|
263 |
num_inference_steps,
|
264 |
solver,
|
265 |
],
|
266 |
-
outputs=output_slider,
|
267 |
)
|
268 |
|
269 |
gr.Examples(
|
@@ -285,4 +279,4 @@ with gr.Blocks() as demo:
|
|
285 |
run_on_click=False,
|
286 |
)
|
287 |
|
288 |
-
demo.launch(share=True, show_error=True)
|
|
|
16 |
|
17 |
TITLE = """
|
18 |
<center>
|
|
|
19 |
<div style="
|
20 |
background-color: #ff9100;
|
21 |
color: #1f2937;
|
|
|
25 |
🚀 NEW: all the Finegrain spaces are now reunited under the
|
26 |
<a href="https://editor.finegrain.ai/signup?utm_source=hf&utm_campaign=image-enhancer" target="_blank">Finegrain Editor</a>. Give it a shot! 🚀
|
27 |
</div>
|
|
|
28 |
<h1 style="font-size: 1.5rem; margin-bottom: 0.5rem;">
|
29 |
Image Enhancer Powered By Refiners
|
30 |
</h1>
|
|
|
31 |
<p>
|
32 |
Turn low resolution images into high resolution versions with added generated details (your image will be modified).
|
33 |
</p>
|
|
|
34 |
<p>
|
35 |
This space is powered by Refiners, our open source micro-framework for simple foundation model adaptation.
|
36 |
If you enjoyed it, please consider starring Refiners on GitHub!
|
37 |
</p>
|
|
|
38 |
<a href="https://github.com/finegrain-ai/refiners" target="_blank">
|
39 |
<img src="https://img.shields.io/github/stars/finegrain-ai/refiners?style=social" />
|
40 |
</a>
|
|
|
41 |
</center>
|
42 |
"""
|
43 |
|
|
|
128 |
denoise_strength: float = 0.35,
|
129 |
num_inference_steps: int = 18,
|
130 |
solver: str = "DDIM",
|
131 |
+
) -> list[Image.Image]: # Changed from tuple to list
|
132 |
manual_seed(seed)
|
133 |
|
134 |
solver_type: type[Solver] = getattr(solvers, solver)
|
|
|
148 |
solver_type=solver_type,
|
149 |
)
|
150 |
|
151 |
+
return [input_image, enhanced_image] # Return a list, not a tuple
|
152 |
|
153 |
|
154 |
with gr.Blocks() as demo:
|
|
|
257 |
num_inference_steps,
|
258 |
solver,
|
259 |
],
|
260 |
+
outputs=[output_slider], # Put outputs in a list here
|
261 |
)
|
262 |
|
263 |
gr.Examples(
|
|
|
279 |
run_on_click=False,
|
280 |
)
|
281 |
|
282 |
+
demo.launch(share=True, show_error=True)
|