randydev commited on
Commit
84695c8
·
verified ·
1 Parent(s): f3a6194

Update Akeno/plugins/imageai.py

Browse files
Files changed (1) hide show
  1. Akeno/plugins/imageai.py +5 -6
Akeno/plugins/imageai.py CHANGED
@@ -44,7 +44,7 @@ async def schellwithflux(args):
44
  & filters.me
45
  & ~filters.forwarded
46
  )
47
- async def fluxai(client: Client, message: Message):
48
  question = message.text.split(" ", 1)[1] if len(message.command) > 1 else None
49
  if not question:
50
  return await message.reply_text("Give ask from Flux")
@@ -53,12 +53,11 @@ async def fluxai(client: Client, message: Message):
53
  return await message.reply_text("Required `HUGGING_TOKEN`")
54
  image_bytes = await schellwithflux(question)
55
  pro = await message.reply_text("Image Generator wait...")
56
- image = Image.open(io.BytesIO(image_bytes))
57
- if image:
58
- image.save("testing.jpg")
59
- ok = await pro.edit_text("Uploading......")
60
  await message.reply_photo("testing.jpg")
61
  await ok.delete()
62
  except Exception as e:
63
  LOGS.error(str(e))
64
- await pro.edit_text(str(e))
 
44
  & filters.me
45
  & ~filters.forwarded
46
  )
47
+ async def imgfluxai_(client: Client, message: Message):
48
  question = message.text.split(" ", 1)[1] if len(message.command) > 1 else None
49
  if not question:
50
  return await message.reply_text("Give ask from Flux")
 
53
  return await message.reply_text("Required `HUGGING_TOKEN`")
54
  image_bytes = await schellwithflux(question)
55
  pro = await message.reply_text("Image Generator wait...")
56
+ with Image.open(io.BytesIO(image_bytes)) as img:
57
+ img.save("testing.jpg", format="JPEG")
58
+ ok = await pro.edit_text("Uploading......")
 
59
  await message.reply_photo("testing.jpg")
60
  await ok.delete()
61
  except Exception as e:
62
  LOGS.error(str(e))
63
+ await pro.edit_text(str(e))