Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,6 @@ import math
|
|
| 15 |
from huggingface_hub import hf_hub_download
|
| 16 |
from safetensors.torch import load_file
|
| 17 |
|
| 18 |
-
import os
|
| 19 |
from PIL import Image
|
| 20 |
import os
|
| 21 |
import gradio as gr
|
|
@@ -59,11 +58,12 @@ MAX_SEED = np.iinfo(np.int32).max
|
|
| 59 |
|
| 60 |
def _generate_video_segment(input_image_path: str, output_image_path: str, prompt: str) -> str:
|
| 61 |
"""Generates a single video segment using the external service."""
|
| 62 |
-
video_client = Client("multimodalart/wan-2-2-first-last-frame")
|
| 63 |
result = video_client.predict(
|
| 64 |
start_image_pil=handle_file(input_image_path),
|
| 65 |
end_image_pil=handle_file(output_image_path),
|
| 66 |
-
prompt=prompt, api_name="/generate_video"
|
|
|
|
| 67 |
)
|
| 68 |
return result[0]["video"]
|
| 69 |
|
|
|
|
| 15 |
from huggingface_hub import hf_hub_download
|
| 16 |
from safetensors.torch import load_file
|
| 17 |
|
|
|
|
| 18 |
from PIL import Image
|
| 19 |
import os
|
| 20 |
import gradio as gr
|
|
|
|
| 58 |
|
| 59 |
def _generate_video_segment(input_image_path: str, output_image_path: str, prompt: str) -> str:
|
| 60 |
"""Generates a single video segment using the external service."""
|
| 61 |
+
video_client = Client("multimodalart/wan-2-2-first-last-frame", hf_token=os.getenv("TEMP_TOKEN"))
|
| 62 |
result = video_client.predict(
|
| 63 |
start_image_pil=handle_file(input_image_path),
|
| 64 |
end_image_pil=handle_file(output_image_path),
|
| 65 |
+
prompt=prompt, api_name="/generate_video",
|
| 66 |
+
|
| 67 |
)
|
| 68 |
return result[0]["video"]
|
| 69 |
|