Update app.py
Browse files
app.py
CHANGED
|
@@ -20,10 +20,8 @@ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_co
|
|
| 20 |
def generate_image_tool(prompt: str) -> str:
|
| 21 |
"""Generates an image from text and returns the file path."""
|
| 22 |
try:
|
| 23 |
-
image = image_generation_tool(prompt)
|
| 24 |
-
|
| 25 |
-
image.save(file_path) # Save it
|
| 26 |
-
return file_path # Return the file path
|
| 27 |
except Exception as e:
|
| 28 |
return f"Error generating image: {str(e)}"
|
| 29 |
|
|
|
|
| 20 |
def generate_image_tool(prompt: str) -> str:
|
| 21 |
"""Generates an image from text and returns the file path."""
|
| 22 |
try:
|
| 23 |
+
image = image_generation_tool(prompt)
|
| 24 |
+
return image # Return the file path
|
|
|
|
|
|
|
| 25 |
except Exception as e:
|
| 26 |
return f"Error generating image: {str(e)}"
|
| 27 |
|