Update main.py
Browse files
main.py
CHANGED
@@ -57,25 +57,25 @@ async def searches(request: Request):
|
|
57 |
return response
|
58 |
|
59 |
@app.route("/imagen", methods=["POST"])
|
60 |
-
def generate_image():
|
61 |
-
data = request.
|
62 |
-
prompt = data
|
63 |
-
model = data.get
|
64 |
-
sampler = data.get
|
65 |
-
seed = int(data.get
|
66 |
-
neg = data.get
|
67 |
|
68 |
response = generate_image_prodia(prompt, model, sampler, seed, neg)
|
69 |
return jsonify({"image": response})
|
70 |
|
71 |
@app.route("/test", methods=["POST"])
|
72 |
-
def test():
|
73 |
-
data = request.
|
74 |
-
prompt = data
|
75 |
-
model = data.get
|
76 |
-
sampler = data.get
|
77 |
-
seed = int(data.get
|
78 |
-
neg = data.get
|
79 |
|
80 |
res = [prompt, \n, model, \n, sampler, \n, seed, \n, neg]
|
81 |
|
|
|
57 |
return response
|
58 |
|
59 |
@app.route("/imagen", methods=["POST"])
|
60 |
+
async def generate_image(request: Request):
|
61 |
+
data = await request.json()
|
62 |
+
prompt = data['prompt']
|
63 |
+
model = data.get["model"]
|
64 |
+
sampler = data.get["sampler"]
|
65 |
+
seed = int(data.get["seed"])
|
66 |
+
neg = data.get["neg"]
|
67 |
|
68 |
response = generate_image_prodia(prompt, model, sampler, seed, neg)
|
69 |
return jsonify({"image": response})
|
70 |
|
71 |
@app.route("/test", methods=["POST"])
|
72 |
+
def test(request: Request):
|
73 |
+
data = await request.json()
|
74 |
+
prompt = data['prompt']
|
75 |
+
model = data.get["model"]
|
76 |
+
sampler = data.get["sampler"]
|
77 |
+
seed = int(data.get["seed"])
|
78 |
+
neg = data.get["neg"]
|
79 |
|
80 |
res = [prompt, \n, model, \n, sampler, \n, seed, \n, neg]
|
81 |
|