Spaces:
Runtime error
Runtime error
returning directly
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from io import BytesIO
|
|
10 |
from Gradio_UI import GradioUI
|
11 |
|
12 |
@tool
|
13 |
-
def image_generator(character:str, sceneDescription:str)->
|
14 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
15 |
"""A tool that returns an image base on a character and a scene setting
|
16 |
Args:
|
@@ -23,8 +23,9 @@ def image_generator(character:str, sceneDescription:str)-> Image: #it's importan
|
|
23 |
try:
|
24 |
# call the image_generation_tool tool with a text prompt
|
25 |
image = image_generation_tool(f"{character} in {sceneDescription}")
|
26 |
-
img = Image.open(BytesIO(image.content))
|
27 |
-
return img
|
|
|
28 |
except Exception as e:
|
29 |
return f"Error fetching image for given inputs: {str(e)}"
|
30 |
|
|
|
10 |
from Gradio_UI import GradioUI
|
11 |
|
12 |
@tool
|
13 |
+
def image_generator(character:str, sceneDescription:str)-> any: #it's important to specify the return type
|
14 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
15 |
"""A tool that returns an image base on a character and a scene setting
|
16 |
Args:
|
|
|
23 |
try:
|
24 |
# call the image_generation_tool tool with a text prompt
|
25 |
image = image_generation_tool(f"{character} in {sceneDescription}")
|
26 |
+
# img = Image.open(BytesIO(image.content))
|
27 |
+
# return img
|
28 |
+
return image
|
29 |
except Exception as e:
|
30 |
return f"Error fetching image for given inputs: {str(e)}"
|
31 |
|