harishraju7 commited on
Commit
b6da1b2
·
verified ·
1 Parent(s): d3fc96e

updated the way in which image is returned from the custom tool

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -22,7 +22,8 @@ def image_generator(character:str, sceneDescription:str)-> Image: #it's importan
22
  try:
23
  # call the image_generation_tool tool with a text prompt
24
  image = image_generation_tool(f"{character} in {sceneDescription}")
25
- return image
 
26
  except Exception as e:
27
  return f"Error fetching image for given inputs: {str(e)}"
28
 
 
22
  try:
23
  # call the image_generation_tool tool with a text prompt
24
  image = image_generation_tool(f"{character} in {sceneDescription}")
25
+ img = Image.open(BytesIO(image_response.content))
26
+ return img
27
  except Exception as e:
28
  return f"Error fetching image for given inputs: {str(e)}"
29