Spaces:
Sleeping
Sleeping
Update app.py
Browse filesajustar implementation de generacion de imagen
app.py
CHANGED
@@ -23,8 +23,8 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
23 |
elif arg2 == 2:
|
24 |
# Generate image using image generation tool
|
25 |
prompt = f"Generate an image based on the following input: {arg1}"
|
26 |
-
|
27 |
-
return f"Image generated: {image_url}"
|
28 |
else:
|
29 |
return "Invalid argument for arg2. Use 1 for text generation and 2 for image generation."
|
30 |
|
|
|
23 |
elif arg2 == 2:
|
24 |
# Generate image using image generation tool
|
25 |
prompt = f"Generate an image based on the following input: {arg1}"
|
26 |
+
image_response = image_generation_tool(prompt)
|
27 |
+
return f"Image generated: {image_response['image_url']}"
|
28 |
else:
|
29 |
return "Invalid argument for arg2. Use 1 for text generation and 2 for image generation."
|
30 |
|