Fetch api for midjourney on discord
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)
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)
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)
Based on MIT License