Update src/app.py
Browse files- src/app.py +2 -21
src/app.py
CHANGED
@@ -4,7 +4,6 @@ import gradio as gr
|
|
4 |
import pillow_heif
|
5 |
import spaces
|
6 |
import torch
|
7 |
-
from gradio_imageslider import ImageSlider
|
8 |
from huggingface_hub import hf_hub_download
|
9 |
from PIL import Image
|
10 |
from refiners.fluxion.utils import manual_seed
|
@@ -165,7 +164,7 @@ def process(
|
|
165 |
solver_type=solver_type,
|
166 |
)
|
167 |
|
168 |
-
return (
|
169 |
|
170 |
|
171 |
with gr.Blocks(delete_cache=(44000, 44000)) as demo:
|
@@ -176,7 +175,7 @@ with gr.Blocks(delete_cache=(44000, 44000)) as demo:
|
|
176 |
input_image = gr.Image(type="pil", label="Input Image")
|
177 |
run_button = gr.ClearButton(components=None, value="Enhance Image")
|
178 |
with gr.Column():
|
179 |
-
output_slider =
|
180 |
run_button.add(output_slider)
|
181 |
|
182 |
with gr.Accordion("Advanced Options", open=False):
|
@@ -277,23 +276,5 @@ with gr.Blocks(delete_cache=(44000, 44000)) as demo:
|
|
277 |
outputs=output_slider,
|
278 |
)
|
279 |
|
280 |
-
gr.Examples(
|
281 |
-
examples=[
|
282 |
-
"examples/kara-eads-L7EwHkq1B2s-unsplash.jpg",
|
283 |
-
"examples/clarity_bird.webp",
|
284 |
-
"examples/edgar-infocus-gJH8AqpiSEU-unsplash.jpg",
|
285 |
-
"examples/jeremy-wallace-_XjW3oN8UOE-unsplash.jpg",
|
286 |
-
"examples/karina-vorozheeva-rW-I87aPY5Y-unsplash.jpg",
|
287 |
-
"examples/karographix-photography-hIaOPjYCEj4-unsplash.jpg",
|
288 |
-
"examples/melissa-walker-horn-gtDYwUIr9Vg-unsplash.jpg",
|
289 |
-
"examples/ryoji-iwata-X53e51WfjlE-unsplash.jpg",
|
290 |
-
"examples/tadeusz-lakota-jggQZkITXng-unsplash.jpg",
|
291 |
-
],
|
292 |
-
inputs=[input_image],
|
293 |
-
outputs=output_slider,
|
294 |
-
fn=process,
|
295 |
-
cache_mode="lazy",
|
296 |
-
run_on_click=False,
|
297 |
-
)
|
298 |
|
299 |
demo.launch(show_error=True, show_api=True)
|
|
|
4 |
import pillow_heif
|
5 |
import spaces
|
6 |
import torch
|
|
|
7 |
from huggingface_hub import hf_hub_download
|
8 |
from PIL import Image
|
9 |
from refiners.fluxion.utils import manual_seed
|
|
|
164 |
solver_type=solver_type,
|
165 |
)
|
166 |
|
167 |
+
return (enhanced_image)
|
168 |
|
169 |
|
170 |
with gr.Blocks(delete_cache=(44000, 44000)) as demo:
|
|
|
175 |
input_image = gr.Image(type="pil", label="Input Image")
|
176 |
run_button = gr.ClearButton(components=None, value="Enhance Image")
|
177 |
with gr.Column():
|
178 |
+
output_slider = gr.Image(label="Output Image")
|
179 |
run_button.add(output_slider)
|
180 |
|
181 |
with gr.Accordion("Advanced Options", open=False):
|
|
|
276 |
outputs=output_slider,
|
277 |
)
|
278 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
|
280 |
demo.launch(show_error=True, show_api=True)
|