Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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="
|
145 |
-
generate_btn = gr.Button("
|
146 |
video = gr.Video()
|
147 |
-
with gr.Accordion("
|
148 |
safetensors_dropdown = gr.Dropdown(
|
149 |
-
label="
|
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="
|
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="
|
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,5 +243,5 @@ with gr.Blocks() as demo:
|
|
243 |
)
|
244 |
|
245 |
if __name__ == "__main__":
|
246 |
-
demo.queue(max_size=
|
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)
|