ka1kuk commited on
Commit
e6992ee
1 Parent(s): dfbec24

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +14 -14
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.get_json()
62
- prompt = data.get("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():
73
- data = request.get_json()
74
- prompt = data.get("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
 
 
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