Merge pull request #2 from syahkty/codex/update-removebg-function-in-app.py
Browse files
app.py
CHANGED
|
@@ -25,7 +25,7 @@ async def health():
|
|
| 25 |
@app.post("/removebg")
|
| 26 |
async def removebg(image: UploadFile = File(...)):
|
| 27 |
img_bytes = await image.read()
|
| 28 |
-
result = await client.image_to_image(img_bytes
|
| 29 |
buf = io.BytesIO()
|
| 30 |
result.save(buf, format="PNG")
|
| 31 |
return Response(content=buf.getvalue(), media_type="image/png")
|
|
|
|
| 25 |
@app.post("/removebg")
|
| 26 |
async def removebg(image: UploadFile = File(...)):
|
| 27 |
img_bytes = await image.read()
|
| 28 |
+
result = await client.image_to_image(img_bytes)
|
| 29 |
buf = io.BytesIO()
|
| 30 |
result.save(buf, format="PNG")
|
| 31 |
return Response(content=buf.getvalue(), media_type="image/png")
|