* * a simple example of how to use the imagine command * ``` * node example/imagine.js * ```
()
| 8 | * ``` |
| 9 | */ |
| 10 | async 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 | } |
| 25 | main().catch((err) => { |
| 26 | console.error(err); |
| 27 | process.exit(1); |
no test coverage detected