CrazyEric commited on
Commit
2e7a676
1 Parent(s): 6050b11

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -138,25 +138,25 @@ def resize_image(image, output_size=(1024, 576)):
138
  return cropped_image
139
 
140
 
141
- with gr.Blocks() as demo:
142
  with gr.Row():
143
  with gr.Column():
144
- image = gr.Image(label="Upload your image", type="pil")
145
- generate_btn = gr.Button("Generate")
146
  video = gr.Video()
147
- with gr.Accordion("Advanced options", open=False):
148
  safetensors_dropdown = gr.Dropdown(
149
- label="Choose Safetensors", choices=get_safetensors_files()
150
  )
151
  seed = gr.Slider(
152
- label="Seed",
153
  value=42,
154
  randomize=False,
155
  minimum=0,
156
  maximum=max_64_bit_int,
157
  step=1,
158
  )
159
- randomize_seed = gr.Checkbox(label="Randomize seed", value=False)
160
  motion_bucket_id = gr.Slider(
161
  label="Motion bucket id",
162
  info="Controls how much motion to add/remove from the image",
@@ -165,42 +165,42 @@ with gr.Blocks() as demo:
165
  maximum=255,
166
  )
167
  fps_id = gr.Slider(
168
- label="Frames per second",
169
  info="The length of your video in seconds will be 25/fps",
170
  value=8,
171
  minimum=5,
172
  maximum=30,
173
  )
174
  width = gr.Slider(
175
- label="Width of input image",
176
  info="It should be divisible by 64",
177
  value=1024,
178
  minimum=576,
179
  maximum=2048,
180
  )
181
  height = gr.Slider(
182
- label="Height of input image",
183
  info="It should be divisible by 64",
184
  value=576,
185
  minimum=320,
186
  maximum=1152,
187
  )
188
  max_guidance_scale = gr.Slider(
189
- label="Max guidance scale",
190
  info="classifier-free guidance strength",
191
  value=1.2,
192
  minimum=1,
193
  maximum=2,
194
  )
195
  min_guidance_scale = gr.Slider(
196
- label="Min guidance scale",
197
  info="classifier-free guidance strength",
198
  value=1,
199
  minimum=1,
200
  maximum=1.5,
201
  )
202
  num_inference_steps = gr.Slider(
203
- label="Num inference steps",
204
  info="steps for inference",
205
  value=4,
206
  minimum=1,
@@ -243,5 +243,5 @@ with gr.Blocks() as demo:
243
  )
244
 
245
  if __name__ == "__main__":
246
- demo.queue(max_size=20, api_open=False)
247
  demo.launch(share=True, show_api=False)
 
138
  return cropped_image
139
 
140
 
141
+ with gr.Blocks(css="footer {visibility: hidden}") as demo:
142
  with gr.Row():
143
  with gr.Column():
144
+ image = gr.Image(label="图片上传", type="pil")
145
+ generate_btn = gr.Button("生成")
146
  video = gr.Video()
147
+ with gr.Accordion("高级设置", open=False):
148
  safetensors_dropdown = gr.Dropdown(
149
+ label="选择模型", choices=get_safetensors_files()
150
  )
151
  seed = gr.Slider(
152
+ label="种子",
153
  value=42,
154
  randomize=False,
155
  minimum=0,
156
  maximum=max_64_bit_int,
157
  step=1,
158
  )
159
+ randomize_seed = gr.Checkbox(label="随机种子", value=False)
160
  motion_bucket_id = gr.Slider(
161
  label="Motion bucket id",
162
  info="Controls how much motion to add/remove from the image",
 
165
  maximum=255,
166
  )
167
  fps_id = gr.Slider(
168
+ label="FPS",
169
  info="The length of your video in seconds will be 25/fps",
170
  value=8,
171
  minimum=5,
172
  maximum=30,
173
  )
174
  width = gr.Slider(
175
+ label="输入图片宽度",
176
  info="It should be divisible by 64",
177
  value=1024,
178
  minimum=576,
179
  maximum=2048,
180
  )
181
  height = gr.Slider(
182
+ label="输入图片高度",
183
  info="It should be divisible by 64",
184
  value=576,
185
  minimum=320,
186
  maximum=1152,
187
  )
188
  max_guidance_scale = gr.Slider(
189
+ label="最大运动控制",
190
  info="classifier-free guidance strength",
191
  value=1.2,
192
  minimum=1,
193
  maximum=2,
194
  )
195
  min_guidance_scale = gr.Slider(
196
+ label="最小运动控制",
197
  info="classifier-free guidance strength",
198
  value=1,
199
  minimum=1,
200
  maximum=1.5,
201
  )
202
  num_inference_steps = gr.Slider(
203
+ label="推理步数",
204
  info="steps for inference",
205
  value=4,
206
  minimum=1,
 
243
  )
244
 
245
  if __name__ == "__main__":
246
+ demo.queue(max_size=30, api_open=False)
247
  demo.launch(share=True, show_api=False)