banner
andrewji8

Being towards death

Heed not to the tree-rustling and leaf-lashing rain, Why not stroll along, whistle and sing under its rein. Lighter and better suited than horses are straw sandals and a bamboo staff, Who's afraid? A palm-leaf plaited cape provides enough to misty weather in life sustain. A thorny spring breeze sobers up the spirit, I feel a slight chill, The setting sun over the mountain offers greetings still. Looking back over the bleak passage survived, The return in time Shall not be affected by windswept rain or shine.
telegram
twitter
github

Midjourney 代理神器來了!

项目簡介#

實現代理 MidJourney 的 discord 頻道,以 API 形式調用 AI 繪圖,更便捷、更靈活!

現有功能#

支持 Imagine 指令和相關 U、V 操作

Imagine 時支持添加圖片 base64,作為墊圖

支持 Blend (圖片混合) 指令和相關 U、V 操作

支持 Describe 指令,根據圖片生成 prompt

支持 Imagine、V、Blend 圖片生成進度

支持中文 prompt 翻譯,需配置百度翻譯或 gpt

prompt 敏感詞判斷,支持覆蓋調整

任務隊列,默認隊列 10,並發 3。可參考 MidJourney 訂閱級別 調整 mj.queue

user-token 連接 wss,可以獲取錯誤信息和完整功能

支持 discord 域名 (server、cdn、wss) 反代,配置 mj.ng-discord

使用前提#

註冊 MidJourney,創建自己的頻道,參考

https://docs.midjourney.com/docs/quick-start

獲取用戶 Token、伺服器 ID、頻道 ID

風險須知#

作圖頻繁等行為,可能會觸發 midjourney 帳號警告,請謹慎使用

為減少風險,請設置 mj.discord.user-agent 和 mj.discord.session-id

默認使用 user-wss 方式,可以獲取 midjourney 的錯誤信息、圖片變換進度等,但可能會增加帳號風險

支持設置 mj.discord.user-wss 為 false,使用 bot-token 連接 wss,需添加自定義機器人:流程說明

Railway 部署#

基於 Railway 平台部署,不需要自己的伺服器:部署方式;若 Railway 不能使用,可用下方的 Zeabur 部署

Zeabur 部署#

基於 Zeabur 平台部署,不需要自己的伺服器:部署方式

Docker 部署#

  1. /xxx/xxx/config 目錄下創建 application.yml (mj 配置項)、banned-words.txt (可選,覆蓋默認的敏感詞文件);參考 src/main/resources 下的文件

  2. 啟動容器,映射 config 目錄

docker run -d --name midjourney-proxy \
 -p 8080:8080 \
 -v /xxx/xxx/config:/home/spring/config \
 --restart=always \
 novicezk/midjourney-proxy:2.3.5

3. 訪問 http://ip:port/mj 查看 API 文檔

附:不映射 config 目錄方式,直接在啟動命令中設置參數

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

配置項#

mj.discord.guild-id:discord 伺服器 ID

mj.discord.channel-id:discord 頻道 ID

mj.discord.user-token:discord 用戶 Token

mj.discord.session-id:discord 用戶的 sessionId,不設置時使用默認的,建議從 interactions 請求中複製替換掉

mj.discord.user-agent:調用 discord 接口、連接 wss 時的 user-agent,默認使用作者的,建議從瀏覽器 network 複製替換掉

mj.discord.user-wss:是否使用 user-token 連接 wss,默認 true

mj.discord.bot-token:自定義機器人 Token,user-wss=false 時必填

更多配置查看

項目連結#

載入中......
此文章數據所有權由區塊鏈加密技術和智能合約保障僅歸創作者所有。