Araeynn commited on
Commit
bf8a213
1 Parent(s): 0156ae0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -522,23 +522,23 @@ async def on_message(message):
522
  else:
523
  raise NotImplementedError(f"Model {imageModel} not found. Report this to @araeyn if this keeps happening.")
524
  image.save("image.png")
525
- file = discord.File(f"{hash(imgp)}.png", filename="image.png", description=imgp)
526
- embed.set_image(url=f"attachment://{hash(imgp)}.png")
527
  embed.set_footer(
528
  text=
529
  """Refining..."""
530
  )
531
  await e.edit(embed=embed, attachments=[file])
532
  gt = time.time()
533
- image, r = (await RF.image_to_image(f"{hash(imgp)}.png", num_inference_steps=16, prompt=imgp, negative_prompt=np), "stable-diffusion-xl-refiner-1.0")
534
  rt = time.time()
535
  embed.set_footer(
536
  text=
537
  f"Image generation model is {m}. Refiner model is {r}. Took {round((gt - st) * 10) / 10} seconds to generate. Took {round((rt - gt) * 10) / 10} seconds to refine."
538
  )
539
  image.save("image.png")
540
- file = discord.File(f"{hash(imgp)}.png", filename="image.png")
541
- embed.set_image(url=f"attachment://{hash(imgp)}.png")
542
  await e.edit(embed=embed, attachments=[file])
543
  except Exception as exc:
544
  print(exc)
 
522
  else:
523
  raise NotImplementedError(f"Model {imageModel} not found. Report this to @araeyn if this keeps happening.")
524
  image.save("image.png")
525
+ file = discord.File(f"{abs(hash(imgp))}.png", filename="image.png", description=imgp)
526
+ embed.set_image(url=f"attachment://{abs(hash(imgp))}.png")
527
  embed.set_footer(
528
  text=
529
  """Refining..."""
530
  )
531
  await e.edit(embed=embed, attachments=[file])
532
  gt = time.time()
533
+ image, r = (await RF.image_to_image(f"{abs(hash(imgp))}.png", num_inference_steps=16, prompt=imgp, negative_prompt=np), "stable-diffusion-xl-refiner-1.0")
534
  rt = time.time()
535
  embed.set_footer(
536
  text=
537
  f"Image generation model is {m}. Refiner model is {r}. Took {round((gt - st) * 10) / 10} seconds to generate. Took {round((rt - gt) * 10) / 10} seconds to refine."
538
  )
539
  image.save("image.png")
540
+ file = discord.File(f"{abs(hash(imgp))}.png", filename="image.png")
541
+ embed.set_image(url=f"attachment://{abs(hash(imgp))}.png")
542
  await e.edit(embed=embed, attachments=[file])
543
  except Exception as exc:
544
  print(exc)