Spaces:
Sleeping
Sleeping
lichorosario
commited on
Commit
•
1dcbd47
1
Parent(s):
7ea4f8f
feat: Refactor upscale function to use new Tile-Upscaler client
Browse files
app.py
CHANGED
@@ -84,22 +84,22 @@ def update_selection(evt: gr.SelectData):
|
|
84 |
)
|
85 |
|
86 |
|
87 |
-
def
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
|
104 |
css="""
|
105 |
"""
|
@@ -220,7 +220,7 @@ with gr.Blocks(css=css) as demo:
|
|
220 |
)
|
221 |
|
222 |
def upscale_with_fixed_values(image):
|
223 |
-
return
|
224 |
|
225 |
scale_btn.click(
|
226 |
fn=upscale_with_fixed_values,
|
|
|
84 |
)
|
85 |
|
86 |
|
87 |
+
def upscale_image(image, resolution, num_inference_steps, strength, hdr, guidance_scale, controlnet_strength, scheduler_name):
|
88 |
+
result = client_tile_upscaler.predict(
|
89 |
+
param_0=handle_file(image),
|
90 |
+
param_1=resolution,
|
91 |
+
param_2=num_inference_steps,
|
92 |
+
param_3=strength,
|
93 |
+
param_4=hdr,
|
94 |
+
param_5=guidance_scale,
|
95 |
+
param_6=controlnet_strength,
|
96 |
+
param_7=scheduler_name,
|
97 |
+
api_name="/wrapper"
|
98 |
+
)
|
99 |
+
return result
|
100 |
+
|
101 |
+
|
102 |
+
|
103 |
|
104 |
css="""
|
105 |
"""
|
|
|
220 |
)
|
221 |
|
222 |
def upscale_with_fixed_values(image):
|
223 |
+
return upscale_image(image, 768, 25, 0.4, 0.3, 7.5)
|
224 |
|
225 |
scale_btn.click(
|
226 |
fn=upscale_with_fixed_values,
|