MCPcopy
hub / github.com/erictik/midjourney-api / main

Function main

example/imagine.js:10–24  ·  view source on GitHub ↗

* * a simple example of how to use the imagine command * ``` * node example/imagine.js * ```

()

Source from the content-addressed store, hash-verified

8 * ```
9 */
10async function main() {
11 const client = new Midjourney({
12 ServerId: process.env.SERVER_ID,
13 ChannelId: process.env.CHANNEL_ID,
14 SalaiToken: process.env.SALAI_TOKEN,
15 Debug: true,
16 Ws: true,
17 SessionId: process.env.SALAI_TOKEN || "8bb7f5b79c7a49f7d0824ab4b8773a81",
18 });
19 await client.init();
20 const msg = await client.Imagine("A little pink elephant", (uri) => {
21 console.log("loading", uri);
22 });
23 console.log({ msg });
24}
25main().catch((err) => {
26 console.error(err);
27 process.exit(1);

Callers 1

imagine.jsFile · 0.70

Calls 3

initMethod · 0.95
ImagineMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected