Spaces:
Running
on
Zero
Running
on
Zero
IceClear
commited on
Commit
·
2785165
1
Parent(s):
7fe120b
update
Browse files
app.py
CHANGED
|
@@ -221,7 +221,7 @@ def generation_step(runner, text_embeds_dict, cond_latents):
|
|
| 221 |
return samples
|
| 222 |
|
| 223 |
@spaces.GPU(duration=120)
|
| 224 |
-
def generation_loop(video_path='./test_videos', seed=666, batch_size=1, cfg_scale=1.0, cfg_rescale=0.0, sample_steps=1, res_h=1280, res_w=720, sp_size=1):
|
| 225 |
runner = configure_runner(1)
|
| 226 |
output_dir = 'output/out.mp4'
|
| 227 |
def _build_pos_and_neg_prompt():
|
|
@@ -386,7 +386,7 @@ def generation_loop(video_path='./test_videos', seed=666, batch_size=1, cfg_scal
|
|
| 386 |
sample = sample.to(torch.uint8).numpy()
|
| 387 |
|
| 388 |
mediapy.write_video(
|
| 389 |
-
output_dir, sample, fps=
|
| 390 |
)
|
| 391 |
|
| 392 |
print(f"Generated video size: {sample.size()}")
|
|
@@ -459,6 +459,7 @@ demo = gr.Interface(
|
|
| 459 |
label="Upload a video"
|
| 460 |
),
|
| 461 |
gr.Number(label="Seeds"),
|
|
|
|
| 462 |
], [
|
| 463 |
gr.Video(label="Output"),
|
| 464 |
gr.File(label="Download the output")
|
|
@@ -467,9 +468,9 @@ demo = gr.Interface(
|
|
| 467 |
description=description,
|
| 468 |
article=article,
|
| 469 |
examples=[
|
| 470 |
-
['./01.mp4', 4],
|
| 471 |
-
['./02.mp4', 4],
|
| 472 |
-
['./03.mp4', 4],
|
| 473 |
]
|
| 474 |
)
|
| 475 |
|
|
|
|
| 221 |
return samples
|
| 222 |
|
| 223 |
@spaces.GPU(duration=120)
|
| 224 |
+
def generation_loop(video_path='./test_videos', seed=666, fps_out=12, batch_size=1, cfg_scale=1.0, cfg_rescale=0.0, sample_steps=1, res_h=1280, res_w=720, sp_size=1):
|
| 225 |
runner = configure_runner(1)
|
| 226 |
output_dir = 'output/out.mp4'
|
| 227 |
def _build_pos_and_neg_prompt():
|
|
|
|
| 386 |
sample = sample.to(torch.uint8).numpy()
|
| 387 |
|
| 388 |
mediapy.write_video(
|
| 389 |
+
output_dir, sample, fps=fps_out
|
| 390 |
)
|
| 391 |
|
| 392 |
print(f"Generated video size: {sample.size()}")
|
|
|
|
| 459 |
label="Upload a video"
|
| 460 |
),
|
| 461 |
gr.Number(label="Seeds"),
|
| 462 |
+
gr.Number(label="fps"),
|
| 463 |
], [
|
| 464 |
gr.Video(label="Output"),
|
| 465 |
gr.File(label="Download the output")
|
|
|
|
| 468 |
description=description,
|
| 469 |
article=article,
|
| 470 |
examples=[
|
| 471 |
+
['./01.mp4', 4, 24],
|
| 472 |
+
['./02.mp4', 4, 24],
|
| 473 |
+
['./03.mp4', 4, 24],
|
| 474 |
]
|
| 475 |
)
|
| 476 |
|