Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ async def generate_image_async(prompt, aspect_ratio):
|
|
36 |
response_data = await response.json()
|
37 |
if "output" in response_data:
|
38 |
return response_data["outputFull"]
|
39 |
-
elif
|
40 |
return response_data['error']
|
41 |
else:
|
42 |
return "Error: Unexpected response from GLIF API."
|
@@ -69,7 +69,7 @@ async def generate_command(
|
|
69 |
try:
|
70 |
await interaction.response.defer()
|
71 |
|
72 |
-
image_url_or_error
|
73 |
# await interaction.response.send_message(f"Error:{image_url_or_error}")
|
74 |
if image_url_or_error not None:
|
75 |
# if image_url_or_error.startswith("http"):
|
|
|
36 |
response_data = await response.json()
|
37 |
if "output" in response_data:
|
38 |
return response_data["outputFull"]
|
39 |
+
elif "error" in response_data:
|
40 |
return response_data['error']
|
41 |
else:
|
42 |
return "Error: Unexpected response from GLIF API."
|
|
|
69 |
try:
|
70 |
await interaction.response.defer()
|
71 |
|
72 |
+
image_url_or_error = await generate_image_async(prompt, aspect_ratio.value)
|
73 |
# await interaction.response.send_message(f"Error:{image_url_or_error}")
|
74 |
if image_url_or_error not None:
|
75 |
# if image_url_or_error.startswith("http"):
|