Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -114,6 +114,13 @@ def document_qna_tool(pdf_path: str, question: str) -> str:
|
|
| 114 |
# -------------------- TOOL 4: Local Image Generation --------------------
|
| 115 |
@tool
|
| 116 |
def image_generator(prompt: str) -> str:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
image = sd_pipe(prompt).images[0]
|
| 118 |
output_path = "generated_image.png"
|
| 119 |
image.save(output_path)
|
|
|
|
| 114 |
# -------------------- TOOL 4: Local Image Generation --------------------
|
| 115 |
@tool
|
| 116 |
def image_generator(prompt: str) -> str:
|
| 117 |
+
"""
|
| 118 |
+
Generate an image from a given text prompt using Stable Diffusion.
|
| 119 |
+
Args:
|
| 120 |
+
prompt (str): Description of the image to generate.
|
| 121 |
+
Returns:
|
| 122 |
+
str: Path to the saved generated image.
|
| 123 |
+
"""
|
| 124 |
image = sd_pipe(prompt).images[0]
|
| 125 |
output_path = "generated_image.png"
|
| 126 |
image.save(output_path)
|