Spaces:
Runtime error
Runtime error
add overlap width option
Browse files
app.py
CHANGED
|
@@ -105,14 +105,14 @@ def fill_image(image, model_selection):
|
|
| 105 |
"""
|
| 106 |
|
| 107 |
@spaces.GPU
|
| 108 |
-
def infer(image, model_selection, ratio_choice):
|
| 109 |
|
| 110 |
source = image
|
| 111 |
|
| 112 |
if ratio_choice == "16:9":
|
| 113 |
target_ratio = (16, 9) # Set the new target ratio to 16:9
|
| 114 |
target_width = 1280 # Adjust target width based on desired resolution
|
| 115 |
-
overlap =
|
| 116 |
#fade_width = 24
|
| 117 |
max_height = 720 # Adjust max height instead of width
|
| 118 |
|
|
@@ -171,7 +171,7 @@ def infer(image, model_selection, ratio_choice):
|
|
| 171 |
|
| 172 |
target_ratio=(9, 16)
|
| 173 |
target_height=1280
|
| 174 |
-
overlap=
|
| 175 |
#fade_width=24
|
| 176 |
max_width = 720
|
| 177 |
# Resize the image if it's wider than max_width
|
|
@@ -267,6 +267,14 @@ with gr.Blocks(css=css) as demo:
|
|
| 267 |
value="RealVisXL V5.0 Lightning",
|
| 268 |
label="Model",
|
| 269 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 270 |
|
| 271 |
run_button = gr.Button("Generate")
|
| 272 |
|
|
@@ -291,7 +299,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 291 |
outputs=result,
|
| 292 |
).then(
|
| 293 |
fn=infer,
|
| 294 |
-
inputs=[input_image, model_selection, ratio],
|
| 295 |
outputs=result,
|
| 296 |
)
|
| 297 |
|
|
|
|
| 105 |
"""
|
| 106 |
|
| 107 |
@spaces.GPU
|
| 108 |
+
def infer(image, model_selection, ratio_choice, overlap_width):
|
| 109 |
|
| 110 |
source = image
|
| 111 |
|
| 112 |
if ratio_choice == "16:9":
|
| 113 |
target_ratio = (16, 9) # Set the new target ratio to 16:9
|
| 114 |
target_width = 1280 # Adjust target width based on desired resolution
|
| 115 |
+
overlap = overlap_width
|
| 116 |
#fade_width = 24
|
| 117 |
max_height = 720 # Adjust max height instead of width
|
| 118 |
|
|
|
|
| 171 |
|
| 172 |
target_ratio=(9, 16)
|
| 173 |
target_height=1280
|
| 174 |
+
overlap=overlap_width
|
| 175 |
#fade_width=24
|
| 176 |
max_width = 720
|
| 177 |
# Resize the image if it's wider than max_width
|
|
|
|
| 267 |
value="RealVisXL V5.0 Lightning",
|
| 268 |
label="Model",
|
| 269 |
)
|
| 270 |
+
|
| 271 |
+
overlap_width = gr.Slider(
|
| 272 |
+
label="Mask overlap width",
|
| 273 |
+
minimum = 1,
|
| 274 |
+
maximum = 50,
|
| 275 |
+
value = 42,
|
| 276 |
+
step = 1
|
| 277 |
+
)
|
| 278 |
|
| 279 |
run_button = gr.Button("Generate")
|
| 280 |
|
|
|
|
| 299 |
outputs=result,
|
| 300 |
).then(
|
| 301 |
fn=infer,
|
| 302 |
+
inputs=[input_image, model_selection, ratio, overlap_width],
|
| 303 |
outputs=result,
|
| 304 |
)
|
| 305 |
|