Move output_count
Browse files- handler.py +2 -3
handler.py
CHANGED
|
@@ -76,14 +76,12 @@ class EndpointHandler():
|
|
| 76 |
"""
|
| 77 |
prompt = data.pop("inputs", None)
|
| 78 |
image = data.pop("image", None)
|
| 79 |
-
|
| 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:
|
| 84 |
return {"error": "Please provide a prompt and base64 encoded image."}
|
| 85 |
-
if output_count is None:
|
| 86 |
-
return {"error": "Please provide an output_count."}
|
| 87 |
|
| 88 |
# Check if a new controlnet is provided
|
| 89 |
if controlnet_type is not None and controlnet_type != self.control_type:
|
|
@@ -101,6 +99,7 @@ class EndpointHandler():
|
|
| 101 |
height = data.pop("height", None)
|
| 102 |
width = data.pop("width", None)
|
| 103 |
controlnet_conditioning_scale = data.pop("controlnet_conditioning_scale", 1.0)
|
|
|
|
| 104 |
|
| 105 |
# process image
|
| 106 |
image = self.decode_base64_image(image)
|
|
|
|
| 76 |
"""
|
| 77 |
prompt = data.pop("inputs", None)
|
| 78 |
image = data.pop("image", None)
|
| 79 |
+
|
| 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:
|
| 84 |
return {"error": "Please provide a prompt and base64 encoded image."}
|
|
|
|
|
|
|
| 85 |
|
| 86 |
# Check if a new controlnet is provided
|
| 87 |
if controlnet_type is not None and controlnet_type != self.control_type:
|
|
|
|
| 99 |
height = data.pop("height", None)
|
| 100 |
width = data.pop("width", None)
|
| 101 |
controlnet_conditioning_scale = data.pop("controlnet_conditioning_scale", 1.0)
|
| 102 |
+
output_count = data.pop("output_count", None)
|
| 103 |
|
| 104 |
# process image
|
| 105 |
image = self.decode_base64_image(image)
|