1.0.0 • Published 12 months ago

midjourney-fetch v1.0.0

Weekly downloads
-
License
-
Repository
github
Last release
12 months ago

midjourney-fetch

npm version GitHub Workflow Status node-current (scoped) GitHub

Fetch api for midjourney on discord

Usage

imagine

import { Midjourney } from 'midjourney-fetch'

const midjourney = new Midjourney({
  channelId: 'your channelId',
  serverId: 'your serverId',
  token: 'your token',
})

const data = await midjourney.imagine('your prompt')

// generated image url
console.log(data.attachments[0].url)

upscale

import { Midjourney } from 'midjourney-fetch'

const midjourney = new Midjourney({
  channelId: 'your channelId',
  serverId: 'your serverId',
  token: 'your token',
})

const image = await midjourney.imagine('your prompt')

const data = await midjourney.upscale('your prompt', {
  messageId: image.id,
  // custom_id could be found at image.component, for example: MJ::JOB::upsample::1::0c266431-26c6-47fa-bfee-2e1e11c7a66f
  customId: 'component custom_id'
})

// generated image url
console.log(data.attachments[0].url)

variation

import { Midjourney } from 'midjourney-fetch'

const midjourney = new Midjourney({
  channelId: 'your channelId',
  serverId: 'your serverId',
  token: 'your token',
})

const image = await midjourney.imagine('your prompt')

const data = await midjourney.variation('your prompt', {
  messageId: image.id,
  // custom_id could be found at image.component, for example: MJ::JOB::variation::1::0c266431-26c6-47fa-bfee-2e1e11c7a66f
  customId: 'component custom_id'
})

// generated image url
console.log(data.attachments[0].url)

How to get Ids and Token

License

Based on MIT License

0.1.5-beta.1

12 months ago

1.0.0

12 months ago

0.1.5-beta.0

12 months ago

0.1.2-beta.0

12 months ago

0.1.2-beta.1

12 months ago

1.0.0-beta.2

12 months ago

1.0.0-beta.3

12 months ago

1.0.0-beta.4

12 months ago

1.0.0-beta.5

12 months ago

1.0.0-beta.0

12 months ago

1.0.0-beta.1

12 months ago

0.1.2

12 months ago

1.0.0-beta.6

12 months ago

1.0.0-beta.7

12 months ago

1.0.0-beta.8

12 months ago

0.1.4

12 months ago

0.1.3

12 months ago

0.1.1

12 months ago

0.1.0

12 months ago