Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -182,9 +182,9 @@ def preprocess_image(input_image: Image.Image) -> Image.Image:
|
|
182 |
if ori_width > 384 or ori_height > 384:
|
183 |
duration = 75
|
184 |
elif ori_width > 512 or ori_height > 512:
|
185 |
-
duration = 120
|
186 |
-
elif ori_width > 1024 or ori_height > 1024:
|
187 |
duration = 240
|
|
|
|
|
188 |
|
189 |
return duration
|
190 |
|
@@ -323,7 +323,7 @@ with gr.Blocks(css=css, theme=theme) as demo:
|
|
323 |
with gr.Row():
|
324 |
with gr.Column():
|
325 |
input_image = gr.Image(type="pil", height=512)
|
326 |
-
run_button = gr.Button("π Magnify
|
327 |
duration_time = gr.Text(label="duration time", value=60, visible=False)
|
328 |
with gr.Accordion("Options", visible=False):
|
329 |
user_prompt = gr.Textbox(label="User Prompt", value="")
|
@@ -338,7 +338,7 @@ with gr.Blocks(css=css, theme=theme) as demo:
|
|
338 |
sample_times = gr.Slider(label="Sample Times", minimum=1, maximum=10, step=1, value=1)
|
339 |
latent_tiled_size = gr.Slider(label="Diffusion Tile Size", minimum=128, maximum=480, value=320, step=1)
|
340 |
latent_tiled_overlap = gr.Slider(label="Diffusion Tile Overlap", minimum=4, maximum=16, value=4, step=1)
|
341 |
-
scale_factor = gr.Number(label="SR Scale", value=
|
342 |
with gr.Column():
|
343 |
result_gallery = ImageSlider(
|
344 |
interactive=False,
|
@@ -371,4 +371,4 @@ with gr.Blocks(css=css, theme=theme) as demo:
|
|
371 |
run_button.click(fn=magnify, inputs=[input_image,duration_time], outputs=[result_gallery])
|
372 |
input_image.upload(fn=preprocess_image,inputs=input_image, outputs=duration_time)
|
373 |
|
374 |
-
demo.launch(share=True)
|
|
|
182 |
if ori_width > 384 or ori_height > 384:
|
183 |
duration = 75
|
184 |
elif ori_width > 512 or ori_height > 512:
|
|
|
|
|
185 |
duration = 240
|
186 |
+
elif ori_width > 1024 or ori_height > 1024:
|
187 |
+
duration = 480
|
188 |
|
189 |
return duration
|
190 |
|
|
|
323 |
with gr.Row():
|
324 |
with gr.Column():
|
325 |
input_image = gr.Image(type="pil", height=512)
|
326 |
+
run_button = gr.Button("π Magnify 4x", variant="primary")
|
327 |
duration_time = gr.Text(label="duration time", value=60, visible=False)
|
328 |
with gr.Accordion("Options", visible=False):
|
329 |
user_prompt = gr.Textbox(label="User Prompt", value="")
|
|
|
338 |
sample_times = gr.Slider(label="Sample Times", minimum=1, maximum=10, step=1, value=1)
|
339 |
latent_tiled_size = gr.Slider(label="Diffusion Tile Size", minimum=128, maximum=480, value=320, step=1)
|
340 |
latent_tiled_overlap = gr.Slider(label="Diffusion Tile Overlap", minimum=4, maximum=16, value=4, step=1)
|
341 |
+
scale_factor = gr.Number(label="SR Scale", value=4)
|
342 |
with gr.Column():
|
343 |
result_gallery = ImageSlider(
|
344 |
interactive=False,
|
|
|
371 |
run_button.click(fn=magnify, inputs=[input_image,duration_time], outputs=[result_gallery])
|
372 |
input_image.upload(fn=preprocess_image,inputs=input_image, outputs=duration_time)
|
373 |
|
374 |
+
demo.launch(share=True)
|