michaelj commited on
Commit
7f49cda
1 Parent(s): f208512

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -24,7 +24,7 @@ def root():
24
  return {"API": "Sum of 2 Squares"}
25
 
26
  @app.post("/img2img")
27
- async def predict(prompt=Body(...),imgbase64data=Body(...)):
28
  pipeline = get_pipeline()
29
  MAX_QUEUE_SIZE = 4
30
  start = time.time()
@@ -32,7 +32,7 @@ async def predict(prompt=Body(...),imgbase64data=Body(...)):
32
  image_data = base64.b64decode(imgbase64data)
33
  image1 = Image.open(io.BytesIO(image_data))
34
  w, h = image1.size
35
- newW = 256
36
  newH = int(h * newW / w)
37
  img = image1.resize((newW, newH))
38
  end1 = time.time()
 
24
  return {"API": "Sum of 2 Squares"}
25
 
26
  @app.post("/img2img")
27
+ async def predict(prompt=Body(...),imgbase64data=Body(...),userId=Body(None)):
28
  pipeline = get_pipeline()
29
  MAX_QUEUE_SIZE = 4
30
  start = time.time()
 
32
  image_data = base64.b64decode(imgbase64data)
33
  image1 = Image.open(io.BytesIO(image_data))
34
  w, h = image1.size
35
+ newW = 512
36
  newH = int(h * newW / w)
37
  img = image1.resize((newW, newH))
38
  end1 = time.time()