midjourney-api
midjourney-api copied to clipboard
The Variation interface cannot be used properly.
async function main() { const client = new Midjourney({ ...config, }) const msg = await client.Imagine('a dog, blue ears, and a red nose') console.log({ msg }) if (!msg) { console.log('no message') return } const msg2 = await client.Variation( msg.content, 2, msg.id, msg.hash, (uri) => { console.log('loading', uri) }, ) console.log({ msg2 }) } main()
and then it return the result like:
{ msg: { id: '1111517800503201842', uri: 'https://cdn.discordapp.com/attachments/1107512663669493833/1111517799899205662/RuthDavis_a_dog_blue_ears_and_a_red_nose_5192b71e-a948-477e-a87b-99ed7bd9857c.png', hash: '5192b71e-a948-477e-a87b-99ed7bd9857c', content: 'a dog, blue ears, and a red nose --seed 7856 --v 5', progress: 'done' } } { msg2: null }
https://github.com/erictik/midjourney-api/blob/main/example/variation-ws.ts
https://github.com/erictik/midjourney-api/blob/main/example/variation-ws.ts
I also used the method given here, but unfortunately, it still didn't return an interface and didn't report an error. However, I saw an output containing 'undefined' in the console. I'm not sure if there is a bug in the program.
my code:
async function main() { const client = new Midjourney({ ...config, Ws: true, Debug: true, }) await client.init() const msg = await client.Imagine('a girl') console.log({ msg }) if (!msg) { console.log('no message') return } const msg2 = await client.Variation( msg.content, 1, msg.id, msg.hash, (uri) => { console.log('loading', uri) }, ) console.log({ msg2 }) } main().catch((err) => { console.error(err) process.exit(1) })
the console:
has message a girl --seed 5060 --v 5 - <@1097411075940560957> (relaxed) undefined 1111576343432396870 2023-05-26T08:47:33.417Z processing image 2023-05-26T08:47:33.417Z
I also have a problem with variation
. When I run it, even if I can see that the variation job finished in my Discord channel, the package does not return anything. It runs forever, without returning any response.
/setting disable remix