Try output_count
Browse files- handler.py +2 -5
handler.py
CHANGED
|
@@ -76,8 +76,8 @@ class EndpointHandler():
|
|
| 76 |
"""
|
| 77 |
prompt = data.pop("inputs", None)
|
| 78 |
image = data.pop("image", None)
|
|
|
|
| 79 |
controlnet_type = data.pop("controlnet_type", None)
|
| 80 |
-
count = data.pop("count", None)
|
| 81 |
|
| 82 |
# Check if neither prompt nor image is provided
|
| 83 |
if prompt is None and image is None:
|
|
@@ -120,10 +120,7 @@ class EndpointHandler():
|
|
| 120 |
|
| 121 |
|
| 122 |
# return first generate PIL image
|
| 123 |
-
|
| 124 |
-
return out.images[0]
|
| 125 |
-
if count is not None:
|
| 126 |
-
return out.images[0:count]
|
| 127 |
|
| 128 |
# helper to decode input image
|
| 129 |
def decode_base64_image(self, image_string):
|
|
|
|
| 76 |
"""
|
| 77 |
prompt = data.pop("inputs", None)
|
| 78 |
image = data.pop("image", None)
|
| 79 |
+
output_count = data.pop("output_count", 1)
|
| 80 |
controlnet_type = data.pop("controlnet_type", None)
|
|
|
|
| 81 |
|
| 82 |
# Check if neither prompt nor image is provided
|
| 83 |
if prompt is None and image is None:
|
|
|
|
| 120 |
|
| 121 |
|
| 122 |
# return first generate PIL image
|
| 123 |
+
return out.images[0, output_count]
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
# helper to decode input image
|
| 126 |
def decode_base64_image(self, image_string):
|