Spaces:
Runtime error
Runtime error
Update app.py
Browse filesTry importing image_generator from Space
app.py
CHANGED
|
@@ -57,7 +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 |
-
image_generation_tool =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
image = image_generation_tool(description)
|
| 62 |
return f"Image generated for prompt: {description}."
|
| 63 |
|
|
|
|
| 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 |
|