Spaces:
Runtime error
Runtime error
Update app.py
Browse filesSwapping to original import method for generate_image
app.py
CHANGED
|
@@ -57,12 +57,12 @@ def generate_image(description: str) -> str:
|
|
| 57 |
Args:
|
| 58 |
description: A string representing the text description to generate an image of.
|
| 59 |
"""
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
)
|
| 65 |
-
|
| 66 |
image = image_generation_tool(description)
|
| 67 |
return f"Image generated for prompt: {description}."
|
| 68 |
|
|
|
|
| 57 |
Args:
|
| 58 |
description: A string representing the text description to generate an image of.
|
| 59 |
"""
|
| 60 |
+
# image_generation_tool = Tool.from_space(
|
| 61 |
+
# "black-forest-labs/FLUX.1-schnell",
|
| 62 |
+
# name="image_generator",
|
| 63 |
+
# description="Generate an image from a prompt"
|
| 64 |
+
# )
|
| 65 |
+
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 66 |
image = image_generation_tool(description)
|
| 67 |
return f"Image generated for prompt: {description}."
|
| 68 |
|