Spaces:
Sleeping
Sleeping
Create core/video_engine.py
Browse files- core/video_engine.py +15 -0
core/video_engine.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
|
| 3 |
+
def generate(prompt):
|
| 4 |
+
response = requests.post(
|
| 5 |
+
"https://api.runwayml.com/v1/video",
|
| 6 |
+
headers={
|
| 7 |
+
"Authorization": "Bearer YOUR_API_KEY"
|
| 8 |
+
},
|
| 9 |
+
json={
|
| 10 |
+
"prompt": prompt,
|
| 11 |
+
"duration": 5
|
| 12 |
+
}
|
| 13 |
+
)
|
| 14 |
+
|
| 15 |
+
return response.json()["output_url"]
|