KarthikAI commited on
Commit
e3abf52
·
verified ·
1 Parent(s): dd3fef9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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(...), prompt: str = Form(...)):
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, prompt)
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")