此工具可用来调用 Midjourney 接口画图。目前已支持的 Midjourney Server:
- GOAPI
- 官方 Midjourney Server
在项目路径下新建 config.yaml
文件,示例如下:
server:
port: 3005
goapi:
baseUrl: https://api.goapi.ai
apikey: xxxxxx
s3:
accessKeyId: xxxxxxxx
secretAccessKey: xxxxxxxx
endpoint: xxxxxxxx
region: xxxxxxxx
bucket: xxxxxxxx
publicAccessUrl: xxxxxxxx
参数含义:
server
:port
: 运行端口,请确保不要和本地的服务冲突。
goapi
:baseUrl
: GoAPI BaseURL 可选,在使用镜像地址时,需要配置此项。apikey
: 请前往 https://www.goapi.ai/ 获取。
s3
: 由于需要将生成的图片上传到 OSS 才能被工作流使用,所以需要配置 S3 相关配置。
-
克隆 GitHub 仓库
git clone https://github.com/inf-monkeys/monkey-tools-midjourney.git
-
安装 Node modules
yarn
-
安装 sharp 包(用于切分图像)
yarn add sharp --ignore-engines
-
启动 server:
此项目默认运行在 8001 端口.
yarn start:debug
在控制台的 执行类工具 菜单,点击右上角的导入按钮,输入此工具的 manifest.json
地址,点击确定。
http://127.0.0.1:8001/manifest.json
可按照你的具体情况做修改。
将此工具的 manifest.json
地址注册到 monkeys
服务的 config.yaml
中 tools
数组中:
tools:
- name: midjourney
manifestUrl: http://127.0.0.1:3005/manifest.json
之后重启服务。