Update handler.py
Browse files- handler.py +16 -2
handler.py
CHANGED
|
@@ -152,7 +152,7 @@ class EndpointHandler:
|
|
| 152 |
return image
|
| 153 |
|
| 154 |
# Debug: Print incoming data
|
| 155 |
-
print("Incoming data:", data)
|
| 156 |
|
| 157 |
face_image_base64 = data.pop("face_image_base64", None)
|
| 158 |
if face_image_base64 is not None:
|
|
@@ -182,6 +182,21 @@ class EndpointHandler:
|
|
| 182 |
enhance_non_face_region = data.pop("enhance_non_face_region", False)
|
| 183 |
seed = data.pop("seed", 42)
|
| 184 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
self.pipe.disable_lora()
|
| 186 |
scheduler_class_name = scheduler.split("-")[0]
|
| 187 |
|
|
@@ -273,4 +288,3 @@ class EndpointHandler:
|
|
| 273 |
img_str = base64.b64encode(buffered.getvalue()).decode("utf-8")
|
| 274 |
|
| 275 |
return {"generated_image_base64": img_str}
|
| 276 |
-
|
|
|
|
| 152 |
return image
|
| 153 |
|
| 154 |
# Debug: Print incoming data
|
| 155 |
+
print("Incoming data:", json.dumps(data, indent=4))
|
| 156 |
|
| 157 |
face_image_base64 = data.pop("face_image_base64", None)
|
| 158 |
if face_image_base64 is not None:
|
|
|
|
| 182 |
enhance_non_face_region = data.pop("enhance_non_face_region", False)
|
| 183 |
seed = data.pop("seed", 42)
|
| 184 |
|
| 185 |
+
print(f"[Debug] Style Name: {style_name}")
|
| 186 |
+
print(f"[Debug] Prompt: {prompt}")
|
| 187 |
+
print(f"[Debug] Negative Prompt: {negative_prompt}")
|
| 188 |
+
print(f"[Debug] IdentityNet Strength Ratio: {identitynet_strength_ratio}")
|
| 189 |
+
print(f"[Debug] Adapter Strength Ratio: {adapter_strength_ratio}")
|
| 190 |
+
print(f"[Debug] Pose Strength: {pose_strength}")
|
| 191 |
+
print(f"[Debug] Canny Strength: {canny_strength}")
|
| 192 |
+
print(f"[Debug] Num Steps: {num_steps}")
|
| 193 |
+
print(f"[Debug] Guidance Scale: {guidance_scale}")
|
| 194 |
+
print(f"[Debug] ControlNet Selection: {controlnet_selection}")
|
| 195 |
+
print(f"[Debug] Scheduler: {scheduler}")
|
| 196 |
+
print(f"[Debug] Enable Fast Inference: {enable_fast_inference}")
|
| 197 |
+
print(f"[Debug] Enhance Non-Face Region: {enhance_non_face_region}")
|
| 198 |
+
print(f"[Debug] Seed: {seed}")
|
| 199 |
+
|
| 200 |
self.pipe.disable_lora()
|
| 201 |
scheduler_class_name = scheduler.split("-")[0]
|
| 202 |
|
|
|
|
| 288 |
img_str = base64.b64encode(buffered.getvalue()).decode("utf-8")
|
| 289 |
|
| 290 |
return {"generated_image_base64": img_str}
|
|
|