Araeynn commited on
Commit
a8dd034
1 Parent(s): 69770d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -196,19 +196,21 @@ async def on_message(message):
196
  text=
197
  """Information or code generated by Lyre may not always be correct. Lyre was made by Araeyn."""
198
  )
 
 
199
  e = await message.reply(embed=embed)
200
  print(imgp)
201
- embed.set_image(url=load)
202
- image = SD.text_to_image(imgp)
203
- image.save("image.png")
204
- image = RF.image_to_image("image.png")
205
- if image["warnings"]:
206
- print(image)
207
- return 0
208
- image.save("image.png")
209
- file = discord.File("image.png", filename="image.png")
210
- embed.set_image(url="attachment://image.png")
211
- await e.edit(embed=embed, attachments=[file])
212
 
213
 
214
  except Exception as e:
 
196
  text=
197
  """Information or code generated by Lyre may not always be correct. Lyre was made by Araeyn."""
198
  )
199
+ if imgp != "":
200
+ embed.set_image(url=load)
201
  e = await message.reply(embed=embed)
202
  print(imgp)
203
+ if imgp != "":
204
+ image = SD.text_to_image(imgp)
205
+ image.save("image.png")
206
+ image = RF.image_to_image("image.png")
207
+ if image["warnings"]:
208
+ print(image)
209
+ return 0
210
+ image.save("image.png")
211
+ file = discord.File("image.png", filename="image.png")
212
+ embed.set_image(url="attachment://image.png")
213
+ await e.edit(embed=embed, attachments=[file])
214
 
215
 
216
  except Exception as e: