Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -104,12 +104,13 @@ def generate_image(data: dict):
|
|
| 104 |
style_name = data['style_name']
|
| 105 |
guidance_scale = data['guidance_scale']
|
| 106 |
image_urls = infer(prompt, style_name=style_name, guidance_scale=guidance_scale)
|
| 107 |
-
|
| 108 |
-
|
| 109 |
image_b64 = image_urls[0].split(",")[1]
|
| 110 |
return {"image_base64": image_b64}
|
| 111 |
else:
|
| 112 |
raise HTTPException(status_code=400, detail="Missing required parameters")
|
|
|
|
| 113 |
|
| 114 |
|
| 115 |
|
|
|
|
| 104 |
style_name = data['style_name']
|
| 105 |
guidance_scale = data['guidance_scale']
|
| 106 |
image_urls = infer(prompt, style_name=style_name, guidance_scale=guidance_scale)
|
| 107 |
+
|
| 108 |
+
# Convert the first generated image to base64
|
| 109 |
image_b64 = image_urls[0].split(",")[1]
|
| 110 |
return {"image_base64": image_b64}
|
| 111 |
else:
|
| 112 |
raise HTTPException(status_code=400, detail="Missing required parameters")
|
| 113 |
+
|
| 114 |
|
| 115 |
|
| 116 |
|