jonathanpark
commited on
Commit
•
9b2c38b
1
Parent(s):
f10ea73
adust inputs
Browse files- handler.py +2 -5
handler.py
CHANGED
@@ -33,11 +33,7 @@ class EndpointHandler():
|
|
33 |
Return:
|
34 |
A :obj:`dict`:. base64 encoded image
|
35 |
"""
|
36 |
-
|
37 |
-
url = data.pop("src", data)
|
38 |
-
print('image', url)
|
39 |
-
response = requests.get(url)
|
40 |
-
init_image = Image.open(BytesIO(response.content)).convert("RGB")
|
41 |
init_image.thumbnail((512, 512))
|
42 |
|
43 |
params = data.pop("parameters", data)
|
@@ -46,6 +42,7 @@ class EndpointHandler():
|
|
46 |
num_inference_steps = params.pop("num_inference_steps", 25)
|
47 |
guidance_scale = params.pop("guidance_scale", 7.5)
|
48 |
negative_prompt = params.pop("negative_prompt", None)
|
|
|
49 |
height = params.pop("height", None)
|
50 |
width = params.pop("width", None)
|
51 |
manual_seed = params.pop("manual_seed", -1)
|
|
|
33 |
Return:
|
34 |
A :obj:`dict`:. base64 encoded image
|
35 |
"""
|
36 |
+
init_image = data.pop("inputs", data)
|
|
|
|
|
|
|
|
|
37 |
init_image.thumbnail((512, 512))
|
38 |
|
39 |
params = data.pop("parameters", data)
|
|
|
42 |
num_inference_steps = params.pop("num_inference_steps", 25)
|
43 |
guidance_scale = params.pop("guidance_scale", 7.5)
|
44 |
negative_prompt = params.pop("negative_prompt", None)
|
45 |
+
prompt = params.pop("prompt", None)
|
46 |
height = params.pop("height", None)
|
47 |
width = params.pop("width", None)
|
48 |
manual_seed = params.pop("manual_seed", -1)
|