2.0.7 • Published 5 days ago

ralex-proxy v2.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
5 days ago

midjourney-client

Node.js client for the unofficial MidJourney api.

Install

npm i midjourney
# or
yarn add midjourney

Usage

import { Midjourney } from "midjourney";
  const client = new Midjourney({
    ServerId: <string>process.env.SERVER_ID,
    ChannelId: <string>process.env.CHANNEL_ID,
    SalaiToken: <string>process.env.SALAI_TOKEN,
    Debug: true,
    Ws:true,
  });
  await client.Connect();
  const Imagine = await client.Imagine("A little pink elephant", (uri: string, progress:string) => {
   console.log("Imagine", uri, "progress", progress);
  });
  console.log({ Imagine });

  const Variation = await client.Variation({
    index: 2,
    msgId: <string>Imagine.id,
    hash: <string>Imagine.hash,
    flags: Imagine.flags,
    loading: (uri: string, progress: string) => {
      console.log("Variation.loading", uri, "progress", progress);
    },
  });
  console.log({ Variation });
  const Upscale = await client.Upscale({
    index: 2,
    msgId: <string>Variation.id,
    hash: <string>Variation.hash,
    flags: Variation.flags,
    loading: (uri: string, progress: string) => {
      console.log("Upscale.loading", uri, "progress", progress);
    },
  });
  console.log({ Upscale });

Example

To run the included example, you must have Node.js installed. Then, run the following commands in the root directory of this project:

  1. clone the repository
git clone https://github.com/erictik/midjourney-client.git
cd midjourney-client
  1. install dependencies
yarn
# or npm
npm install
  1. set the environment variables
#example variables, please set up yours

export SERVER_ID="1082500871478329374"
export CHANNEL_ID="1094892992281718894"
export SALAI_TOKEN="your-salai-token"

Then, run the example with the following command:

npx tsx example/imagine-ws.ts

route-map

  • /imagine variation upscale reroll blend zoomout vary
  • /info
  • /fast and /relax
  • /describe
  • /settings reset
  • verify human
  • proxy
  • autoload command payload

Projects


Star History

Star History Chart

2.0.7

5 days ago

2.0.5

22 days ago

2.0.4

22 days ago

2.0.6

22 days ago

2.0.3

23 days ago

2.0.2

23 days ago

2.0.1

23 days ago

1.0.44

2 months ago

1.0.43

2 months ago

1.0.45

2 months ago

1.0.42

2 months ago

1.0.41

2 months ago

1.0.40

2 months ago

1.0.39

2 months ago

1.0.38

2 months ago

1.0.26

2 months ago

1.0.25

2 months ago

1.0.24

2 months ago

1.0.29

2 months ago

1.0.27

2 months ago

1.0.33

2 months ago

1.0.32

2 months ago

1.0.30

2 months ago

1.0.37

2 months ago

1.0.36

2 months ago

1.0.35

2 months ago

1.0.34

2 months ago

1.0.23

2 months ago

1.0.22

2 months ago

1.0.21

2 months ago

1.0.20

2 months ago

1.0.19

3 months ago

1.0.18

3 months ago

1.0.17

3 months ago

1.0.16

3 months ago

1.0.15

3 months ago

1.0.14

4 months ago

1.0.13

5 months ago

1.0.12

7 months ago

1.0.9

8 months ago

1.0.11

8 months ago

1.0.10

8 months ago

1.0.8

10 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago