Texttra commited on
Commit
ec2c1d4
·
verified ·
1 Parent(s): 6f92f77

Update handler.py

Browse files
Files changed (1) hide show
  1. 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 PNG: {str(e)}"}
 
 
 
 
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: