Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -99,8 +99,8 @@ def infer(prompt, negative="low_quality", style_name=None, guidance_scale=None):
|
|
| 99 |
|
| 100 |
@app.route("/", methods=["POST", "GET"])
|
| 101 |
async def generate_image(request: Request):
|
| 102 |
-
|
| 103 |
-
|
| 104 |
if 'prompt' in data and 'style_name' in data and 'guidance_scale' in data:
|
| 105 |
prompt = data['prompt']
|
| 106 |
style_name = data['style_name']
|
|
|
|
| 99 |
|
| 100 |
@app.route("/", methods=["POST", "GET"])
|
| 101 |
async def generate_image(request: Request):
|
| 102 |
+
body = await request.body()
|
| 103 |
+
data = json.loads(body)
|
| 104 |
if 'prompt' in data and 'style_name' in data and 'guidance_scale' in data:
|
| 105 |
prompt = data['prompt']
|
| 106 |
style_name = data['style_name']
|