mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 14:13:02 -04:00
use imagen3
This commit is contained in:
parent
91c7a6850c
commit
90b4b0c6a8
3 changed files with 13 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
const {googleGenaiImagen} = require("#api");
|
||||
const { PERMISSION_GROUPS } = require("#constants");
|
||||
const { GenerativeImagesModelsImagen } = require("#obelisk");
|
||||
|
||||
const { createEmbed } = require("#utils/embed");
|
||||
const { acknowledge } = require("#utils/interactions");
|
||||
|
@ -39,20 +39,20 @@ module.exports = {
|
|||
url: STATIC_ASSETS.image_loading_splash(Math.floor(Math.random()*10))
|
||||
}
|
||||
}))
|
||||
};
|
||||
}
|
||||
|
||||
await editOrReply(context, {embeds: loadingEmbeds});
|
||||
|
||||
let res = await GenerativeImagesModelsImagen(context, args.text);
|
||||
let res = await googleGenaiImagen(context, args.text);
|
||||
|
||||
// Construct Embeds
|
||||
let files = [];
|
||||
let embeds = res.response.body.images.map((i)=>{
|
||||
let imgName = `lcigen.${(Date.now() + Math.random()).toString(36)}.jpeg`;
|
||||
let embeds = res.response.body.predictions.map((i)=>{
|
||||
let imgName = `lcigen.${(Date.now() + Math.random()).toString(36)}.${i.mimeType.split("/")[1]}`;
|
||||
|
||||
files.push({
|
||||
filename: imgName,
|
||||
value: Buffer.from(i, 'base64')
|
||||
value: Buffer.from(i.bytesBase64Encoded, 'base64')
|
||||
})
|
||||
return createEmbed("defaultNoFooter", context, {
|
||||
url: "https://bignutty.gitlab.io",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue