Commit
·
3cba83e
1
Parent(s):
be4f2db
load url for image to image pipe
Browse files- handler.py +4 -4
handler.py
CHANGED
|
@@ -32,12 +32,12 @@ class EndpointHandler():
|
|
| 32 |
Return:
|
| 33 |
A :obj:`dict`:. base64 encoded image
|
| 34 |
"""
|
| 35 |
-
|
| 36 |
-
init_image = Image.open(image_data).convert("RGB")
|
| 37 |
-
init_image.thumbnail((512, 512))
|
| 38 |
-
|
| 39 |
params = data.pop("parameters", data)
|
| 40 |
|
|
|
|
|
|
|
|
|
|
| 41 |
# hyperparamters
|
| 42 |
num_inference_steps = params.pop("num_inference_steps", 25)
|
| 43 |
guidance_scale = params.pop("guidance_scale", 7.5)
|
|
|
|
| 32 |
Return:
|
| 33 |
A :obj:`dict`:. base64 encoded image
|
| 34 |
"""
|
| 35 |
+
prompt = data.pop("inputs", data)
|
|
|
|
|
|
|
|
|
|
| 36 |
params = data.pop("parameters", data)
|
| 37 |
|
| 38 |
+
url = params.pop("url", data)
|
| 39 |
+
init_image = Image.open(url).convert("RGB")
|
| 40 |
+
init_image.thumbnail((512, 512))
|
| 41 |
# hyperparamters
|
| 42 |
num_inference_steps = params.pop("num_inference_steps", 25)
|
| 43 |
guidance_scale = params.pop("guidance_scale", 7.5)
|