Spaces:
Runtime error
Runtime error
updated the way in which image is returned from the custom tool
Browse files
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 |
-
|
|
|
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 |
|