Add check for count
Browse files- handler.py +4 -1
handler.py
CHANGED
|
@@ -76,12 +76,15 @@ class EndpointHandler():
|
|
| 76 |
"""
|
| 77 |
prompt = data.pop("inputs", None)
|
| 78 |
image = data.pop("image", None)
|
| 79 |
-
count = data.pop("count",
|
| 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:
|
|
|
|
| 76 |
"""
|
| 77 |
prompt = data.pop("inputs", None)
|
| 78 |
image = data.pop("image", None)
|
| 79 |
+
count = data.pop("count", None)
|
| 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 |
+
if count is None:
|
| 87 |
+
return {"error": "Please provide a count."}
|
| 88 |
|
| 89 |
# Check if a new controlnet is provided
|
| 90 |
if controlnet_type is not None and controlnet_type != self.control_type:
|