Update handler.py
Browse files- handler.py +7 -7
handler.py
CHANGED
|
@@ -53,19 +53,19 @@ class EndpointHandler():
|
|
| 53 |
|
| 54 |
prompt = data.pop("prompt", "")
|
| 55 |
|
| 56 |
-
if(method == "smooth"):
|
| 57 |
-
if encoded_image is not None:
|
| 58 |
-
image = self.decode_base64_image(encoded_image)
|
| 59 |
-
out = self.smooth_pipe(prompt, image=image).images[0]
|
| 60 |
-
|
| 61 |
-
return out
|
| 62 |
-
|
| 63 |
negative_prompt = data.pop("negative_prompt", "")
|
| 64 |
|
| 65 |
method = data.pop("method", "slow")
|
| 66 |
strength = data.pop("strength", 0.2)
|
| 67 |
guidance_scale = data.pop("guidance_scale", 8.0)
|
| 68 |
num_inference_steps = data.pop("num_inference_steps", 20)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
# process image
|
| 71 |
if encoded_image is not None and encoded_mask_image is not None:
|
|
|
|
| 53 |
|
| 54 |
prompt = data.pop("prompt", "")
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
negative_prompt = data.pop("negative_prompt", "")
|
| 57 |
|
| 58 |
method = data.pop("method", "slow")
|
| 59 |
strength = data.pop("strength", 0.2)
|
| 60 |
guidance_scale = data.pop("guidance_scale", 8.0)
|
| 61 |
num_inference_steps = data.pop("num_inference_steps", 20)
|
| 62 |
+
|
| 63 |
+
if(method == "smooth"):
|
| 64 |
+
if encoded_image is not None:
|
| 65 |
+
image = self.decode_base64_image(encoded_image)
|
| 66 |
+
out = self.smooth_pipe(prompt, image=image).images[0]
|
| 67 |
+
|
| 68 |
+
return out
|
| 69 |
|
| 70 |
# process image
|
| 71 |
if encoded_image is not None and encoded_mask_image is not None:
|