https://github.com/gptgenius/midjourney-fetch
Nodejs api for Midjourney on discord
https://github.com/gptgenius/midjourney-fetch
discord discord-api midjourney midjourney-api
Last synced: 3 months ago
JSON representation
Nodejs api for Midjourney on discord
- Host: GitHub
- URL: https://github.com/gptgenius/midjourney-fetch
- Owner: GPTGenius
- License: mit
- Created: 2023-05-13T13:50:06.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-24T02:26:51.000Z (over 2 years ago)
- Last Synced: 2025-06-01T12:11:50.877Z (4 months ago)
- Topics: discord, discord-api, midjourney, midjourney-api
- Language: TypeScript
- Homepage:
- Size: 103 KB
- Stars: 25
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# midjourney-fetch
[](https://www.npmjs.com/package/midjourney-fetch)   Fetch api for midjourney on discord
## Usage
### imagine
```typescript
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
```typescript
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
```typescript
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
- [How to find ids](https://docs.statbot.net/docs/faq/general/how-find-id/)
- [Get discord token](https://www.androidauthority.com/get-discord-token-3149920/)## License
Based on [MIT License](./LICENSE)