Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -55,7 +55,7 @@ def can_expand(source_width, source_height, target_width, target_height, alignme
|
|
55 |
return True
|
56 |
|
57 |
@spaces.GPU(duration=24)
|
58 |
-
def infer(image, width, height, overlap_width, num_inference_steps, resize_option, custom_resize_size, prompt_input=None, alignment="Middle"):
|
59 |
source = image
|
60 |
target_size = (width, height)
|
61 |
overlap = overlap_width
|
@@ -221,7 +221,7 @@ def create_video_from_images(image_list, fps=4):
|
|
221 |
video.release()
|
222 |
return video_path
|
223 |
|
224 |
-
def loop_outpainting(image, width, height, overlap_width, num_inference_steps, resize_option, custom_resize_size, prompt_input, alignment, num_iterations, fps, progress=gr.Progress()):
|
225 |
image_list = [image]
|
226 |
current_image = image
|
227 |
|
@@ -336,7 +336,13 @@ with gr.Blocks(css=css) as demo:
|
|
336 |
)
|
337 |
use_as_input_button = gr.Button("Use as Input Image", visible=False)
|
338 |
video_output = gr.Video(label="Outpainting Video")
|
339 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
def use_output_as_input(output_image):
|
341 |
"""Sets the generated output as the new input image."""
|
342 |
return gr.update(value=output_image[1])
|
|
|
55 |
return True
|
56 |
|
57 |
@spaces.GPU(duration=24)
|
58 |
+
def infer(image, width=1024, height=1024, overlap_width=18, num_inference_steps=8, resize_option="custom", custom_resize_size=768, prompt_input=None, alignment="Middle"):
|
59 |
source = image
|
60 |
target_size = (width, height)
|
61 |
overlap = overlap_width
|
|
|
221 |
video.release()
|
222 |
return video_path
|
223 |
|
224 |
+
def loop_outpainting(image, width=1024, height=1024, overlap_width=18, num_inference_steps=8, resize_option="custom", custom_resize_size=768, prompt_input=None, alignment="Middle", num_iterations=18, fps=6, progress=gr.Progress()):
|
225 |
image_list = [image]
|
226 |
current_image = image
|
227 |
|
|
|
336 |
)
|
337 |
use_as_input_button = gr.Button("Use as Input Image", visible=False)
|
338 |
video_output = gr.Video(label="Outpainting Video")
|
339 |
+
gr.Example(
|
340 |
+
examples=["hide.png", "disaster.png"],
|
341 |
+
fn=loop_outpainting,
|
342 |
+
inputs=input_image,
|
343 |
+
outputs=video_output,
|
344 |
+
cache_examples="lazy"
|
345 |
+
)
|
346 |
def use_output_as_input(output_image):
|
347 |
"""Sets the generated output as the new input image."""
|
348 |
return gr.update(value=output_image[1])
|