Project Introduction#
Implement the discord channel of the proxy MidJourney to call AI drawing in API form, more convenient and flexible!
Existing Features#
Support Imagine commands and related U, V operations
Support adding base64 images as placeholders when using Imagine
Support Blend (image blending) commands and related U, V operations
Support Describe commands to generate prompts based on images
Support progress generation for Imagine, V, Blend images
Support Chinese prompt translation, need to configure Baidu translation or GPT
Prompt sensitive word judgment, support override adjustment
Task queue, default queue 10, concurrency 3. Can refer to MidJourney subscription level to adjust mj.queue
User-token connects to wss, can get error information and complete functions
Support discord domain name (server, cdn, wss) reverse proxy, configure mj.ng-discord
Prerequisites#
Register MidJourney, create your own channel, refer to
https://docs.midjourney.com/docs/quick-start
Get user Token, server ID, channel ID
Risk Notice#
Frequent drawing and other behaviors may trigger warnings on the midjourney account, please use with caution
To reduce risks, please set mj.discord.user-agent and mj.discord.session-id
By default, use the user-wss method, which can get midjourney's error information, image transformation progress, etc., but it may increase account risks
Support setting mj.discord.user-wss to false, use bot-token to connect wss, and add custom robots: process description
Railway Deployment#
Deploy based on the Railway platform, no need for your own server: deployment method; if Railway cannot be used, you can use the Zeabur deployment below
Zeabur Deployment#
Deploy based on the Zeabur platform, no need for your own server: deployment method
Docker Deployment#
-
Create application.yml (mj configuration item) and banned-words.txt (optional, override the default sensitive word file) in the /xxx/xxx/config directory; refer to the files under src/main/resources
-
Start the container and map the config directory
docker run -d --name midjourney-proxy \
-p 8080:8080 \
-v /xxx/xxx/config:/home/spring/config \
--restart=always \
novicezk/midjourney-proxy:2.3.5
- Access http://ip:port/mj to view the API documentation
Attachment: Directly set parameters in the startup command without mapping the config directory
docker run -d --name midjourney-proxy \
-p 8080:8080 \
-e mj.discord.guild-id=xxx \
-e mj.discord.channel-id=xxx \
-e mj.discord.user-token=xxx \
--restart=always \
novicezk/midjourney-proxy:2.3.5
Configuration Items#
mj.discord.guild-id: discord server ID
mj.discord.channel-id: discord channel ID
mj.discord.user-token: discord user Token
mj.discord.session-id: discord user's sessionId, use the default when not set, it is recommended to copy and replace it from the interactions request
mj.discord.user-agent: user-agent when calling discord interface and connecting wss, use the author's default, it is recommended to copy and replace it from the browser network
mj.discord.user-wss: whether to use user-token to connect wss, default true
mj.discord.bot-token: custom robot Token, required when user-wss=false
More configurations can be viewed at