Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -35,8 +35,7 @@ async def generate_image_async(prompt, aspect_ratio):
|
|
35 |
response.raise_for_status()
|
36 |
response_data = await response.json()
|
37 |
if "output" in response_data:
|
38 |
-
return response_data["
|
39 |
-
elif "error" in response_data:
|
40 |
return response_data['error']
|
41 |
else:
|
42 |
return "Error: Unexpected response from GLIF API."
|
@@ -71,9 +70,11 @@ async def generate_command(
|
|
71 |
|
72 |
image_url_or_error, additional_data = 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
|
|
|
75 |
await interaction.followup.send(
|
76 |
-
f"Here's your generated image based on the prompt '{prompt}' with aspect ratio {aspect_ratio.name}:\n{image_url_or_error}
|
|
|
77 |
)
|
78 |
else:
|
79 |
await interaction.followup.send(
|
|
|
35 |
response.raise_for_status()
|
36 |
response_data = await response.json()
|
37 |
if "output" in response_data:
|
38 |
+
return response_data["outputFull"]
|
|
|
39 |
return response_data['error']
|
40 |
else:
|
41 |
return "Error: Unexpected response from GLIF API."
|
|
|
70 |
|
71 |
image_url_or_error, additional_data = await generate_image_async(prompt, aspect_ratio.value)
|
72 |
# await interaction.response.send_message(f"Error:{image_url_or_error}")
|
73 |
+
if image_url_or_error not None:
|
74 |
+
# if image_url_or_error.startswith("http"):
|
75 |
await interaction.followup.send(
|
76 |
+
# f"Here's your generated image based on the prompt '{prompt}' with aspect ratio {aspect_ratio.name}:\n{image_url_or_error}"
|
77 |
+
f"data:{image_url_or_error}"
|
78 |
)
|
79 |
else:
|
80 |
await interaction.followup.send(
|