Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -234,7 +234,6 @@ def pipe_generate(img,p1,p2,motion,time,title):
|
|
234 |
guidance_scale=accu,
|
235 |
num_videos_per_prompt=1,
|
236 |
num_frames=(fps*time),
|
237 |
-
need_safetycheck=False,
|
238 |
generator=torch.Generator(device).manual_seed(int(str(random.random()).split(".")[1]))
|
239 |
).frames[0]
|
240 |
|
@@ -270,7 +269,10 @@ def handle_generate(*_inp):
|
|
270 |
pipe_out.save(name)
|
271 |
else:
|
272 |
export_to_video(pipe_out,name,fps=fps)
|
273 |
-
|
|
|
|
|
|
|
274 |
|
275 |
def ui():
|
276 |
global result
|
@@ -329,8 +331,10 @@ def ui():
|
|
329 |
value="",
|
330 |
interactive=True
|
331 |
)
|
332 |
-
with gr.Row():
|
333 |
-
|
|
|
|
|
334 |
with gr.Row():
|
335 |
run_button = gr.Button("Start!",elem_classes="btn",scale=0)
|
336 |
|
@@ -342,7 +346,7 @@ def ui():
|
|
342 |
],
|
343 |
fn=handle_generate,
|
344 |
inputs=[img,prompt,prompt2,motion,time,title],
|
345 |
-
outputs=
|
346 |
)
|
347 |
demo.queue().launch()
|
348 |
|
|
|
234 |
guidance_scale=accu,
|
235 |
num_videos_per_prompt=1,
|
236 |
num_frames=(fps*time),
|
|
|
237 |
generator=torch.Generator(device).manual_seed(int(str(random.random()).split(".")[1]))
|
238 |
).frames[0]
|
239 |
|
|
|
269 |
pipe_out.save(name)
|
270 |
else:
|
271 |
export_to_video(pipe_out,name,fps=fps)
|
272 |
+
if inp[4] == 0:
|
273 |
+
return name, ""
|
274 |
+
else:
|
275 |
+
return "", name
|
276 |
|
277 |
def ui():
|
278 |
global result
|
|
|
331 |
value="",
|
332 |
interactive=True
|
333 |
)
|
334 |
+
with gr.Row(scale=0.5):
|
335 |
+
res_img = gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=True, type='filepath', show_share_button=False)
|
336 |
+
with gr.Row(scale=0.5):
|
337 |
+
res_vid = gr.Video(interactive=False,elem_classes="image-container", label="Result", show_label=True, type='filepath', show_share_button=False)
|
338 |
with gr.Row():
|
339 |
run_button = gr.Button("Start!",elem_classes="btn",scale=0)
|
340 |
|
|
|
346 |
],
|
347 |
fn=handle_generate,
|
348 |
inputs=[img,prompt,prompt2,motion,time,title],
|
349 |
+
outputs=[res_img,res_vid]
|
350 |
)
|
351 |
demo.queue().launch()
|
352 |
|