File size: 492 Bytes
963e6d9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from flask import Flask, render_template, request, jsonify
from api.generate_video import create_video

app = Flask(__name__)

@app.route("/")
def home():
    return render_template("index.html")

@app.route("/api/video", methods=["POST"])
def video():
    data = request.json
    prompt = data["prompt"]

    job_id = create_video(prompt)

    return jsonify({
        "status": "processing",
        "job_id": job_id
    })

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=7860)