2.0.22 • Published 6 months ago

ralex-proxy v2.0.22

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months 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.19

6 months ago

2.0.18

6 months ago

2.0.22

6 months ago

2.0.20

6 months ago

2.0.21

6 months ago

2.0.16

9 months ago

2.0.17

9 months ago

2.0.9

1 year ago

2.0.8

1 year ago

2.0.15

10 months ago

2.0.13

10 months ago

2.0.14

10 months ago

2.0.11

11 months ago

2.0.12

11 months ago

2.0.10

1 year ago

2.0.7

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.6

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

1.0.44

1 year ago

1.0.43

1 year ago

1.0.45

1 year ago

1.0.42

1 year ago

1.0.41

1 year ago

1.0.40

1 year ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.29

1 year ago

1.0.27

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.30

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.9

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago