CrazyEric commited on
Commit
056eabc
1 Parent(s): 8010ebe

- 去除项目相关信息
- footer 处理

Files changed (1) hide show
  1. app.py +11 -11
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('''# Community demo for Stable Video Diffusion - Img2Vid - XT ([model](https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt), [paper](https://stability.ai/research/stable-video-diffusion-scaling-latent-video-diffusion-models-to-large-datasets), [stability's ui waitlist](https://stability.ai/contact))
90
- #### Research release ([_non-commercial_](https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt/blob/main/LICENSE)): generate `4s` vid from a single image at (`25 frames` at `6 fps`). this demo uses [🧨 diffusers for low VRAM and fast generation](https://huggingface.co/docs/diffusers/main/en/using-diffusers/svd).
91
  ''')
92
  with gr.Row():
93
  with gr.Column():
94
- image = gr.Image(label="Upload your image", type="pil")
95
- generate_btn = gr.Button("Generate")
96
  video = gr.Video()
97
- with gr.Accordion("Advanced options", 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="Randomize seed", value=True)
100
- motion_bucket_id = gr.Slider(label="Motion bucket id", info="Controls how much motion to add/remove from the image", value=127, minimum=1, maximum=255)
101
- fps_id = gr.Slider(label="Frames per second", info="The length of your video in seconds will be 25/fps", 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="video")
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",