Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,11 +16,11 @@ from PIL import Image
|
|
| 16 |
app = FastAPI()
|
| 17 |
|
| 18 |
@app.post("/generate")
|
| 19 |
-
async def generate(image: UploadFile = File(...),
|
| 20 |
# Read image file as PIL
|
| 21 |
image_pil = Image.open(BytesIO(await image.read()))
|
| 22 |
# Generate sticker
|
| 23 |
-
result_img = generate_sticker(image_pil,
|
| 24 |
# Save output image to a buffer
|
| 25 |
buf = BytesIO()
|
| 26 |
result_img.save(buf, format="PNG")
|
|
|
|
| 16 |
app = FastAPI()
|
| 17 |
|
| 18 |
@app.post("/generate")
|
| 19 |
+
async def generate(image: UploadFile = File(...), style: str = Form("chibi")):
|
| 20 |
# Read image file as PIL
|
| 21 |
image_pil = Image.open(BytesIO(await image.read()))
|
| 22 |
# Generate sticker
|
| 23 |
+
result_img = generate_sticker(image_pil, style)
|
| 24 |
# Save output image to a buffer
|
| 25 |
buf = BytesIO()
|
| 26 |
result_img.save(buf, format="PNG")
|