Update handler.py
Browse files- handler.py +3 -2
handler.py
CHANGED
@@ -76,6 +76,7 @@ class EndpointHandler():
|
|
76 |
"""
|
77 |
prompt = data.pop("inputs", None)
|
78 |
image = data.pop("image", None)
|
|
|
79 |
controlnet_type = data.pop("controlnet_type", None)
|
80 |
|
81 |
# Check if neither prompt nor image is provided
|
@@ -110,7 +111,7 @@ class EndpointHandler():
|
|
110 |
image=control_image,
|
111 |
num_inference_steps=num_inference_steps,
|
112 |
guidance_scale=guidance_scale,
|
113 |
-
num_images_per_prompt=
|
114 |
height=height,
|
115 |
width=width,
|
116 |
controlnet_conditioning_scale=controlnet_conditioning_scale,
|
@@ -119,7 +120,7 @@ class EndpointHandler():
|
|
119 |
|
120 |
|
121 |
# return first generate PIL image
|
122 |
-
return out.images[0]
|
123 |
|
124 |
# helper to decode input image
|
125 |
def decode_base64_image(self, image_string):
|
|
|
76 |
"""
|
77 |
prompt = data.pop("inputs", None)
|
78 |
image = data.pop("image", None)
|
79 |
+
count = data.pop("count", 1)
|
80 |
controlnet_type = data.pop("controlnet_type", None)
|
81 |
|
82 |
# Check if neither prompt nor image is provided
|
|
|
111 |
image=control_image,
|
112 |
num_inference_steps=num_inference_steps,
|
113 |
guidance_scale=guidance_scale,
|
114 |
+
num_images_per_prompt=count,
|
115 |
height=height,
|
116 |
width=width,
|
117 |
controlnet_conditioning_scale=controlnet_conditioning_scale,
|
|
|
120 |
|
121 |
|
122 |
# return first generate PIL image
|
123 |
+
return out.images[0, count]
|
124 |
|
125 |
# helper to decode input image
|
126 |
def decode_base64_image(self, image_string):
|