jbilcke-hf HF staff commited on
Commit
32097c5
·
1 Parent(s): 45f3f73

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -19
app.py CHANGED
@@ -106,28 +106,25 @@ with gr.Blocks() as demo:
106
  secret_token = gr.Text(
107
  label='Secret Token',
108
  max_lines=1,
109
- placeholder='Enter your secret token',
110
- )
111
- gr.HTML("""
112
- <div style="z-index: 100; position: fixed; top: 0px; right: 0px; left: 0px; bottom: 0px; width: 100%; height: 100%; background: white; display: flex; align-items: center; justify-content: center; color: black;">
113
- <div style="text-align: center; color: black;">
114
- <p style="color: black;">This space is a REST API to programmatically generate MP4 videos.</p>
115
- <p style="color: black;">Interested in using it? Look no further than the <a href="https://huggingface.co/spaces/multimodalart/stable-video-diffusion" target="_blank">original space</a>!</p>
116
- </div>
117
- </div>"""
118
- )
119
- image = gr.Image(label="Upload your image", type="pil")
120
- generate_btn = gr.Button("Generate")
121
- base64_out = gr.Textbox(label="Base64 Video")
122
- seed = gr.Slider(label="Seed", value=42, randomize=False, minimum=0, maximum=max_64_bit_int, step=1)
123
- 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)
124
- 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)
125
-
126
  generate_btn.click(
127
  fn=generate_video,
128
  inputs=[secret_token, image, seed, motion_bucket_id, fps_id],
129
  outputs=base64_out,
130
- api_name="run"
131
- )
132
 
133
  demo.queue(max_size=20).launch()
 
106
  secret_token = gr.Text(
107
  label='Secret Token',
108
  max_lines=1,
109
+ placeholder='Enter your secret token')
110
+ gr.HTML("""
111
+ <div style="z-index: 100; position: fixed; top: 0px; right: 0px; left: 0px; bottom: 0px; width: 100%; height: 100%; background: white; display: flex; align-items: center; justify-content: center; color: black;">
112
+ <div style="text-align: center; color: black;">
113
+ <p style="color: black;">This space is a REST API to programmatically generate MP4 videos.</p>
114
+ <p style="color: black;">Interested in using it? Look no further than the <a href="https://huggingface.co/spaces/multimodalart/stable-video-diffusion" target="_blank">original space</a>!</p>
115
+ </div>
116
+ </div>""")
117
+ image = gr.Image(label="Upload your image", type="pil")
118
+ generate_btn = gr.Button("Generate")
119
+ base64_out = gr.Textbox(label="Base64 Video")
120
+ seed = gr.Slider(label="Seed", value=42, randomize=False, minimum=0, maximum=max_64_bit_int, step=1)
121
+ 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)
122
+ 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)
123
+
 
 
124
  generate_btn.click(
125
  fn=generate_video,
126
  inputs=[secret_token, image, seed, motion_bucket_id, fps_id],
127
  outputs=base64_out,
128
+ api_name="run")
 
129
 
130
  demo.queue(max_size=20).launch()