Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,18 +30,6 @@ class WanAnimateApp:
|
|
| 30 |
_, image_url = check_and_upload_local(model_id, ref_img, DASHSCOPE_API_KEY)
|
| 31 |
_, video_url = check_and_upload_local(model_id, video, DASHSCOPE_API_KEY)
|
| 32 |
|
| 33 |
-
# Prepare the request payload (NSFW checks removed)
|
| 34 |
-
payload = {
|
| 35 |
-
"model": model_id,
|
| 36 |
-
"input": {
|
| 37 |
-
"image_url": image_url,
|
| 38 |
-
"video_url": video_url
|
| 39 |
-
},
|
| 40 |
-
"parameters": {
|
| 41 |
-
"mode": model
|
| 42 |
-
}
|
| 43 |
-
}
|
| 44 |
-
|
| 45 |
# Set up headers
|
| 46 |
headers = {
|
| 47 |
"X-DashScope-Async": "enable",
|
|
@@ -84,10 +72,6 @@ class WanAnimateApp:
|
|
| 84 |
# Task completed successfully, return video URL
|
| 85 |
video_url = result["output"]["results"]["video_url"]
|
| 86 |
return video_url, "SUCCEEDED"
|
| 87 |
-
elif task_status == "FAILED":
|
| 88 |
-
return None, f"Task failed: {error_msg} Code: {code_msg} TaskId: {task_id}"
|
| 89 |
-
# raise Exception(f"Task failed: {error_msg} TaskId: {task_id}")
|
| 90 |
-
else:
|
| 91 |
# Task is still running, wait and retry
|
| 92 |
time.sleep(5) # Wait 5 seconds before polling again
|
| 93 |
|
|
|
|
| 30 |
_, image_url = check_and_upload_local(model_id, ref_img, DASHSCOPE_API_KEY)
|
| 31 |
_, video_url = check_and_upload_local(model_id, video, DASHSCOPE_API_KEY)
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
# Set up headers
|
| 34 |
headers = {
|
| 35 |
"X-DashScope-Async": "enable",
|
|
|
|
| 72 |
# Task completed successfully, return video URL
|
| 73 |
video_url = result["output"]["results"]["video_url"]
|
| 74 |
return video_url, "SUCCEEDED"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
# Task is still running, wait and retry
|
| 76 |
time.sleep(5) # Wait 5 seconds before polling again
|
| 77 |
|