Spaces:
Runtime error
Runtime error
UI update
Browse files- 去除项目相关信息
- footer 处理
app.py
CHANGED
@@ -85,23 +85,23 @@ def resize_image(image, output_size=(1024, 576)):
|
|
85 |
cropped_image = resized_image.crop((left, top, right, bottom))
|
86 |
return cropped_image
|
87 |
|
88 |
-
with gr.Blocks() as demo:
|
89 |
-
gr.Markdown('''#
|
90 |
-
####
|
91 |
''')
|
92 |
with gr.Row():
|
93 |
with gr.Column():
|
94 |
-
image = gr.Image(label="
|
95 |
-
generate_btn = gr.Button("
|
96 |
video = gr.Video()
|
97 |
-
with gr.Accordion("
|
98 |
-
seed = gr.Slider(label="Seed", value=42, randomize=True, minimum=0, maximum=max_64_bit_int, step=1)
|
99 |
-
randomize_seed = gr.Checkbox(label="
|
100 |
-
motion_bucket_id = gr.Slider(label="Motion bucket id", info="
|
101 |
-
fps_id = gr.Slider(label="
|
102 |
|
103 |
image.upload(fn=resize_image, inputs=image, outputs=image, queue=False)
|
104 |
-
generate_btn.click(fn=sample, inputs=[image, seed, randomize_seed, motion_bucket_id, fps_id], outputs=[video, seed], api_name="
|
105 |
gr.Examples(
|
106 |
examples=[
|
107 |
"images/blink_meme.png",
|
|
|
85 |
cropped_image = resized_image.crop((left, top, right, bottom))
|
86 |
return cropped_image
|
87 |
|
88 |
+
with gr.Blocks(css="footer {visibility: hidden}") as demo:
|
89 |
+
gr.Markdown('''# AI 视频生成
|
90 |
+
#### 由单张图片生成一小段视频
|
91 |
''')
|
92 |
with gr.Row():
|
93 |
with gr.Column():
|
94 |
+
image = gr.Image(label="上传图片", type="pil")
|
95 |
+
generate_btn = gr.Button("开始生成视频")
|
96 |
video = gr.Video()
|
97 |
+
with gr.Accordion("高级选项", open=False):
|
98 |
+
seed = gr.Slider(label="Seed 种子数", value=42, randomize=True, minimum=0, maximum=max_64_bit_int, step=1)
|
99 |
+
randomize_seed = gr.Checkbox(label="随机", value=True)
|
100 |
+
motion_bucket_id = gr.Slider(label="Motion bucket id", info="控制画面运动", value=127, minimum=1, maximum=255)
|
101 |
+
fps_id = gr.Slider(label="帧率", info="每秒的画面数量", value=6, minimum=5, maximum=30)
|
102 |
|
103 |
image.upload(fn=resize_image, inputs=image, outputs=image, queue=False)
|
104 |
+
generate_btn.click(fn=sample, inputs=[image, seed, randomize_seed, motion_bucket_id, fps_id], outputs=[video, seed], api_name="生成视频")
|
105 |
gr.Examples(
|
106 |
examples=[
|
107 |
"images/blink_meme.png",
|