Update main.py
Browse files
main.py
CHANGED
@@ -38,7 +38,7 @@ agent_chain = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCR
|
|
38 |
|
39 |
|
40 |
@app.get("/")
|
41 |
-
def
|
42 |
return "Hello! My name is Linlada."
|
43 |
|
44 |
@app.post('/linlada')
|
@@ -68,8 +68,21 @@ async def generate_image(request: Request):
|
|
68 |
response = generate_image_prodia(prompt, model, sampler, seed, neg)
|
69 |
return jsonify({"image": response})
|
70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
@app.route("/test", methods=["POST"])
|
72 |
-
async def test(request:
|
73 |
-
data =
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
return data
|
75 |
|
|
|
38 |
|
39 |
|
40 |
@app.get("/")
|
41 |
+
def hello():
|
42 |
return "Hello! My name is Linlada."
|
43 |
|
44 |
@app.post('/linlada')
|
|
|
68 |
response = generate_image_prodia(prompt, model, sampler, seed, neg)
|
69 |
return jsonify({"image": response})
|
70 |
|
71 |
+
class User(BaseModel):
|
72 |
+
prompt: str,
|
73 |
+
model: str,
|
74 |
+
sampler: str,
|
75 |
+
seed: int,
|
76 |
+
neg: str or None
|
77 |
+
|
78 |
@app.route("/test", methods=["POST"])
|
79 |
+
async def test(request: User):
|
80 |
+
data = {
|
81 |
+
'prompt': request.prompt,
|
82 |
+
'model': request.model,
|
83 |
+
'sampler': request.sampler,
|
84 |
+
'seed': request.seed,
|
85 |
+
'neg': request.neg
|
86 |
+
}
|
87 |
return data
|
88 |
|