erictik / midjourney-api

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

Variations to the same image returns the same image #70

Open allentofight opened 1 year ago

allentofight commented 1 year ago

the code that reproduces this issue or a replay of the bug

When call any one of V1~V4 by using the following code:

await client.Variation(
    msg.content,
    2,
    <string>msg.id,
    <string>msg.hash,
    (uri: string, progress: string) => {
      console.log("loading", uri, "progress", progress);
    }
  );
  console.log({ msg2 });
}

, it works well, but when call another one V1~V4 which is different from the previous one, it always returns the previous one immediately

change your code like the following can reproduce the phenomenon!


    const client = new Midjourney({
      ServerId: '1112940597846749225',
      ChannelId: '1112940597846749228',
      SalaiToken: process.env.MJ_SALAI_TOKEN!,
      Debug: true,
    });

    const msg = await client.Imagine("a dog, blue ears, and a red nose --q .25");
    console.log({ msg });
    if (!msg) {
      console.log("no message");
      return;
    }
    const msg2 = await client.Variation(
      msg.content,
      2,
      msg.id,
      msg.hash,
      (uri: string) => {
        console.log("loading", uri);
      }
    );
    console.log({ msg2 });

    const msg3 = await client.Variation(
      msg.content,
      3,
      msg.id,
      msg.hash,
      (uri: string) => {
        console.log("loading", uri);
      }
    );
    console.log({ msg3 });

Describe the bug

Describe the bug A clear and concise description of what the bug is.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

error log

none

jubak01 commented 1 year ago

+1

allentofight commented 1 year ago

I notice that other project just add a identity before the prompt, so it can be recognized, maybe you can reference it image

sukbearai commented 1 year ago

I ran into the same problem and the loading callback didn't work either

Dr-Alex-Dr commented 1 year ago

I've been trying to solve this problem for several days now :(

zcpua commented 1 year ago

https://github.com/erictik/midjourney-api/commit/d5369f92f1b741d88e9fa12af234df490e6f149d