emmac commited on
Commit
599b3e9
·
verified ·
1 Parent(s): da904c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -51,10 +51,9 @@ def generate_image(prompt: str) -> AgentImage:
51
  Args:
52
  prompt: The text description of the image to generate.
53
  """
54
- img = _image_generator(prompt=prompt) # returns a PIL image in your tests
55
- out_path = f"/tmp/{uuid.uuid4().hex}.png"
56
- img.save(out_path)
57
- return AgentImage(out_path)
58
 
59
 
60
  final_answer = FinalAnswerTool()
 
51
  Args:
52
  prompt: The text description of the image to generate.
53
  """
54
+ pil_img = _image_generator(prompt=prompt) # PIL image
55
+ return AgentImage(pil_img) # ✅ wrap the PIL object, not a filepath
56
+
 
57
 
58
 
59
  final_answer = FinalAnswerTool()