Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -56,10 +56,13 @@ optimize_pipeline_(pipe, image=[Image.new("RGB", (1024, 1024)), Image.new("RGB",
|
|
| 56 |
|
| 57 |
MAX_SEED = np.iinfo(np.int32).max
|
| 58 |
|
| 59 |
-
def _generate_video_segment(input_image_path: str, output_image_path: str, prompt: str
|
| 60 |
"""Generates a single video segment using the external service."""
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
| 63 |
result = video_client.predict(
|
| 64 |
start_image_pil=handle_file(input_image_path),
|
| 65 |
end_image_pil=handle_file(output_image_path),
|
|
@@ -152,6 +155,11 @@ def infer_camera_edit(
|
|
| 152 |
|
| 153 |
def create_video_between_images(input_image, output_image, prompt: str, request: gr.Request) -> str:
|
| 154 |
"""Create a video between the input and output images."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
if input_image is None or output_image is None:
|
| 156 |
raise gr.Error("Both input and output images are required to create a video.")
|
| 157 |
|
|
|
|
| 56 |
|
| 57 |
MAX_SEED = np.iinfo(np.int32).max
|
| 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 |
+
from gradio.context import LocalContext
|
| 62 |
+
request = LocalContext.request.get(None)
|
| 63 |
+
print(f"Request available in _generate_video_segment: {request is not None} {request}")
|
| 64 |
+
print("x-ip", request.headers["x-ip-token"])
|
| 65 |
+
video_client = Client("multimodalart/wan-2-2-first-last-frame")
|
| 66 |
result = video_client.predict(
|
| 67 |
start_image_pil=handle_file(input_image_path),
|
| 68 |
end_image_pil=handle_file(output_image_path),
|
|
|
|
| 155 |
|
| 156 |
def create_video_between_images(input_image, output_image, prompt: str, request: gr.Request) -> str:
|
| 157 |
"""Create a video between the input and output images."""
|
| 158 |
+
from gradio.context import LocalContext
|
| 159 |
+
request = LocalContext.request.get(None)
|
| 160 |
+
print(f"Request available in create_video_between_images: {request is not None} {request}")
|
| 161 |
+
print("x-ip", request.headers["x-ip-token"])
|
| 162 |
+
|
| 163 |
if input_image is None or output_image is None:
|
| 164 |
raise gr.Error("Both input and output images are required to create a video.")
|
| 165 |
|