Update Akeno/plugins/imageai.py
Browse files- 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
|
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 |
-
|
57 |
-
|
58 |
-
|
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))
|