Update handler.py
Browse files- handler.py +5 -1
handler.py
CHANGED
|
@@ -48,7 +48,11 @@ class EndpointHandler:
|
|
| 48 |
image_bytes = base64.b64decode(image_input)
|
| 49 |
image = Image.open(BytesIO(image_bytes)).convert("RGB")
|
| 50 |
except Exception as e:
|
| 51 |
-
return {"error": f"Failed to decode 'image' as base64
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
# Generate edited image with Kontext
|
| 54 |
try:
|
|
|
|
| 48 |
image_bytes = base64.b64decode(image_input)
|
| 49 |
image = Image.open(BytesIO(image_bytes)).convert("RGB")
|
| 50 |
except Exception as e:
|
| 51 |
+
return {"error": f"Failed to decode 'image' as base64: {str(e)}"}
|
| 52 |
+
|
| 53 |
+
# Debug prints for prompt and image size
|
| 54 |
+
print(f"📝 Final prompt: {prompt}")
|
| 55 |
+
print(f"🖼️ Image size: {image.size}")
|
| 56 |
|
| 57 |
# Generate edited image with Kontext
|
| 58 |
try:
|