erictik / midjourney-api

MidJourney client. Unofficial Node.js client
Apache License 2.0
1.68k stars 280 forks source link

The Variation interface cannot be used properly. #50

Open varnew opened 1 year ago

varnew commented 1 year ago

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 }

zcpua commented 1 year ago

https://github.com/erictik/midjourney-api/blob/main/example/variation-ws.ts

varnew commented 1 year ago

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

johnykes commented 1 year ago

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.

zcpua commented 1 year ago

/setting disable remix