Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -91,7 +91,7 @@ class TextToImageTool(Tool):
|
|
| 91 |
def forward(self, prompt):
|
| 92 |
return self.client.text_to_image(prompt)
|
| 93 |
'''
|
| 94 |
-
|
| 95 |
class TextToImageTool(Tool):
|
| 96 |
description = "This tool creates an image according to a prompt. Add details like 'high-res, photorealistic'."
|
| 97 |
name = "image_generator"
|
|
@@ -116,12 +116,19 @@ class TextToImageTool(Tool):
|
|
| 116 |
def forward(self, prompt):
|
| 117 |
image = self.pipe(prompt).images[0]
|
| 118 |
return image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
|
| 121 |
# =========================================================
|
| 122 |
# Tool and Agent Initialization
|
| 123 |
# =========================================================
|
| 124 |
-
image_generation_tool= TextToImageTool()
|
| 125 |
#image_generation_tool = WrappedTextToImageTool()
|
| 126 |
search_tool = DuckDuckGoSearchTool()
|
| 127 |
llm_engine = InferenceClientModel("Qwen/Qwen2.5-72B-Instruct")
|
|
|
|
| 91 |
def forward(self, prompt):
|
| 92 |
return self.client.text_to_image(prompt)
|
| 93 |
'''
|
| 94 |
+
'''
|
| 95 |
class TextToImageTool(Tool):
|
| 96 |
description = "This tool creates an image according to a prompt. Add details like 'high-res, photorealistic'."
|
| 97 |
name = "image_generator"
|
|
|
|
| 116 |
def forward(self, prompt):
|
| 117 |
image = self.pipe(prompt).images[0]
|
| 118 |
return image
|
| 119 |
+
'''
|
| 120 |
+
|
| 121 |
+
image_generation_tool = Tool.from_space(
|
| 122 |
+
"black-forest-labs/FLUX.1-schnell",
|
| 123 |
+
name="image_generator",
|
| 124 |
+
description="Generate an image from a prompt"
|
| 125 |
+
)
|
| 126 |
|
| 127 |
|
| 128 |
# =========================================================
|
| 129 |
# Tool and Agent Initialization
|
| 130 |
# =========================================================
|
| 131 |
+
#image_generation_tool= TextToImageTool()
|
| 132 |
#image_generation_tool = WrappedTextToImageTool()
|
| 133 |
search_tool = DuckDuckGoSearchTool()
|
| 134 |
llm_engine = InferenceClientModel("Qwen/Qwen2.5-72B-Instruct")
|