Fix /timelapse endpoint with correct Gradio API params
Browse filesCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main.py
CHANGED
|
@@ -30,11 +30,11 @@ async def generate_timelapse(
|
|
| 30 |
|
| 31 |
client = Client("multimodalart/wan-2-2-first-last-frame")
|
| 32 |
result = client.predict(
|
| 33 |
-
|
| 34 |
-
|
| 35 |
prompt=prompt,
|
| 36 |
-
api_name="/
|
| 37 |
)
|
| 38 |
|
| 39 |
-
output_path = result if isinstance(result,
|
| 40 |
return FileResponse(output_path, media_type="video/mp4", filename="timelapse.mp4")
|
|
|
|
| 30 |
|
| 31 |
client = Client("multimodalart/wan-2-2-first-last-frame")
|
| 32 |
result = client.predict(
|
| 33 |
+
start_image_pil=handle_file(start_path),
|
| 34 |
+
end_image_pil=handle_file(end_path),
|
| 35 |
prompt=prompt,
|
| 36 |
+
api_name="/generate_video",
|
| 37 |
)
|
| 38 |
|
| 39 |
+
output_path = result[0] if isinstance(result, (list, tuple)) else result
|
| 40 |
return FileResponse(output_path, media_type="video/mp4", filename="timelapse.mp4")
|