fvonhoven commited on
Commit
1bf8f52
·
1 Parent(s): d22825a

Add catch for output_count

Browse files
Files changed (1) hide show
  1. handler.py +3 -1
handler.py CHANGED
@@ -76,12 +76,14 @@ class EndpointHandler():
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:
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
+ output_count = data.pop("output_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
+ 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: