Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,7 +48,6 @@ def _trim_first_frame_fast(video_path: str) -> str:
|
|
| 48 |
Removes exactly the first frame of a video without re-encoding.
|
| 49 |
This is the frame-accurate and fast method.
|
| 50 |
"""
|
| 51 |
-
gr.Info("Preparing video segment...")
|
| 52 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".mp4") as tmp_output_file:
|
| 53 |
output_path = tmp_output_file.name
|
| 54 |
|
|
@@ -72,7 +71,6 @@ def _combine_videos_simple(video1_path: str, video2_path: str) -> str:
|
|
| 72 |
"""
|
| 73 |
Combines two videos using the fast concat demuxer. Assumes video2 is already trimmed.
|
| 74 |
"""
|
| 75 |
-
gr.Info("Stitching videos...")
|
| 76 |
with tempfile.NamedTemporaryFile(delete=False, mode='w', suffix=".txt") as tmp_list_file:
|
| 77 |
tmp_list_file.write(f"file '{os.path.abspath(video1_path)}'\n")
|
| 78 |
tmp_list_file.write(f"file '{os.path.abspath(video2_path)}'\n")
|
|
@@ -97,7 +95,6 @@ def _combine_videos_simple(video1_path: str, video2_path: str) -> str:
|
|
| 97 |
|
| 98 |
def _generate_video_segment(input_image_path: str, output_image_path: str, prompt: str, token: str) -> str:
|
| 99 |
"""Generates a single video segment using the external service."""
|
| 100 |
-
gr.Info("Generating new video segment...")
|
| 101 |
video_client = Client("multimodalart/wan-2-2-first-last-frame", hf_token=token)
|
| 102 |
result = video_client.predict(
|
| 103 |
start_image_pil=handle_file(input_image_path),
|
|
|
|
| 48 |
Removes exactly the first frame of a video without re-encoding.
|
| 49 |
This is the frame-accurate and fast method.
|
| 50 |
"""
|
|
|
|
| 51 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".mp4") as tmp_output_file:
|
| 52 |
output_path = tmp_output_file.name
|
| 53 |
|
|
|
|
| 71 |
"""
|
| 72 |
Combines two videos using the fast concat demuxer. Assumes video2 is already trimmed.
|
| 73 |
"""
|
|
|
|
| 74 |
with tempfile.NamedTemporaryFile(delete=False, mode='w', suffix=".txt") as tmp_list_file:
|
| 75 |
tmp_list_file.write(f"file '{os.path.abspath(video1_path)}'\n")
|
| 76 |
tmp_list_file.write(f"file '{os.path.abspath(video2_path)}'\n")
|
|
|
|
| 95 |
|
| 96 |
def _generate_video_segment(input_image_path: str, output_image_path: str, prompt: str, token: str) -> str:
|
| 97 |
"""Generates a single video segment using the external service."""
|
|
|
|
| 98 |
video_client = Client("multimodalart/wan-2-2-first-last-frame", hf_token=token)
|
| 99 |
result = video_client.predict(
|
| 100 |
start_image_pil=handle_file(input_image_path),
|