Spaces:
Running
on
Zero
Running
on
Zero
lucakempkes
commited on
Commit
·
3bbaf85
1
Parent(s):
bdb95dc
new image slider, output as png
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
import spaces
|
3 |
-
from gradio_imageslider import ImageSlider
|
4 |
from image_gen_aux import UpscaleWithModel
|
5 |
from image_gen_aux.utils import load_image
|
6 |
from fastapi.middleware.cors import CORSMiddleware
|
@@ -16,7 +15,7 @@ MODELS = {
|
|
16 |
@spaces.GPU
|
17 |
def upscale_image(image, model_selection):
|
18 |
original = load_image(image)
|
19 |
-
|
20 |
upscaler = UpscaleWithModel.from_pretrained(MODELS[model_selection]).to("cuda")
|
21 |
image = upscaler(original, tiling=True, tile_width=1024, tile_height=1024)
|
22 |
|
@@ -45,9 +44,10 @@ with gr.Blocks() as demo:
|
|
45 |
|
46 |
run_button = gr.Button("Upscale")
|
47 |
with gr.Column():
|
48 |
-
result = ImageSlider(
|
49 |
interactive=False,
|
50 |
label="Generated Image",
|
|
|
51 |
)
|
52 |
|
53 |
run_button.click(
|
|
|
1 |
import gradio as gr
|
2 |
import spaces
|
|
|
3 |
from image_gen_aux import UpscaleWithModel
|
4 |
from image_gen_aux.utils import load_image
|
5 |
from fastapi.middleware.cors import CORSMiddleware
|
|
|
15 |
@spaces.GPU
|
16 |
def upscale_image(image, model_selection):
|
17 |
original = load_image(image)
|
18 |
+
|
19 |
upscaler = UpscaleWithModel.from_pretrained(MODELS[model_selection]).to("cuda")
|
20 |
image = upscaler(original, tiling=True, tile_width=1024, tile_height=1024)
|
21 |
|
|
|
44 |
|
45 |
run_button = gr.Button("Upscale")
|
46 |
with gr.Column():
|
47 |
+
result = gr.ImageSlider(
|
48 |
interactive=False,
|
49 |
label="Generated Image",
|
50 |
+
format="png"
|
51 |
)
|
52 |
|
53 |
run_button.click(
|