Spaces:
Running
Running
Create api/generate_video.py
Browse files- api/generate_video.py +12 -0
api/generate_video.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import uuid
|
| 2 |
+
from core.video_engine import generate
|
| 3 |
+
|
| 4 |
+
def create_video(prompt):
|
| 5 |
+
job_id = str(uuid.uuid4())
|
| 6 |
+
|
| 7 |
+
video_url = generate(prompt)
|
| 8 |
+
|
| 9 |
+
with open("jobs/queue.json", "a") as f:
|
| 10 |
+
f.write(f"{job_id}:{video_url}\n")
|
| 11 |
+
|
| 12 |
+
return job_id
|