* * a simple example of how to use the imagine command * ``` * npx tsx example/imagine-err.ts * ```
()
| 8 | * ``` |
| 9 | */ |
| 10 | async function main() { |
| 11 | const client = new Midjourney({ |
| 12 | ServerId: <string>process.env.SERVER_ID, |
| 13 | ChannelId: <string>process.env.CHANNEL_ID, |
| 14 | SalaiToken: <string>process.env.SALAI_TOKEN, |
| 15 | Debug: true, |
| 16 | }); |
| 17 | await client.init(); |
| 18 | // `https://images.guapitu.com/chatgpt/5b9b907a/d3297338-ae3e-4276-9bd9-3b6ca27cedcf.png |
| 19 | // https://images.guapitu.com/chatgpt/762a2db4/459d52f1-23fd-41c3-a912-317e65155fcc.png |
| 20 | // https://images.guapitu.com/chatgpt/f86613ac/2e2497ae-9906-44d9-8396-e41abab2f47b.png |
| 21 | // cat` |
| 22 | const prompt = `%s %sTiny cute isometric Hcia illustration, a girl with long white hair, smile, seawater, colorful bubbles, dreamy portrait, Teana punk, more details, fiber tracking, snail core, Kuvshinov Ilya, yakamoz emoji, soft lighting, soft colors, matte clay, blender 3d, pastel background --v 5.1 --ar 1:1 --s 350 --q 1`; |
| 23 | const msg = await client.Imagine(prompt, (uri: string, progress: string) => { |
| 24 | console.log("loading", uri, "progress", progress); |
| 25 | }); |
| 26 | console.log({ msg }); |
| 27 | } |
| 28 | main().catch((err) => { |
| 29 | console.error(err); |
| 30 | process.exit(1); |
no test coverage detected