Skip to content

Commit f25502f

Browse files
author
zhukai
committed
feat: 发布3.1版本
1 parent 837e542 commit f25502f

File tree

4 files changed

+42
-26
lines changed

4 files changed

+42
-26
lines changed

docs/api.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
- 执行CustomZoom(自定义变焦)
8282
- 执行PicReader(Describe后选择生图)
8383
- 执行PromptAnalyzer(Shorten后选择生图)
84-
- 账号开启了Remix & 配置remix为true & 执行Reroll、Variation、Pan
84+
- 账号开启了Remix & 执行Reroll、Variation、Pan
8585

8686
调用 `/mj/submit/modal`
8787
```json
@@ -121,7 +121,7 @@ CustomZoom的prompt需要设置`--ar` 和 `--zoom`(1到2之间),例如: `Cat -
121121
## 5. `/mj/submit/shorten` prompt分析
122122
```json
123123
{
124-
"prompt": "️appdash appdash, in the style of expert draftsmanship, commission for, ethereal, dreamlike quality, dadaistic, toonami"
124+
"prompt": "️appdash appdash, in the style of expert draftsmanship, commission for, ethereal, dreamlike quality, dadaistic, toonami"
125125
}
126126
```
127127

@@ -154,7 +154,19 @@ CustomZoom的prompt需要设置`--ar` 和 `--zoom`(1到2之间),例如: `Cat -
154154
}
155155
```
156156

157-
## 6. 任务变更回调
157+
## 6. 获取任务图片的seed
158+
绘图任务执行后,不会设置seed,如需获取seed,需要执行 `/mj/task/{id}/image-seed`
159+
- code=1: 获取成功,result为图片对应的seed
160+
```json
161+
{
162+
"code": 1,
163+
"description": "成功",
164+
"result": "636646138"
165+
}
166+
```
167+
- other: 执行错误,description为错误描述
168+
169+
## 7. 任务变更回调
158170
任务状态变化或进度改变时,会调用业务系统的接口
159171
- 接口地址为配置的 mj.notify-hook,任务提交时支持传`notifyHook`以改变此任务的回调地址
160172
- 两者都为空时,不触发回调

docs/config.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,14 @@
22

33
| 变量名 | 非空 | 描述 |
44
| :-----| :----: | :---- |
5-
| mj.accounts || 参考 [账号池配置](./config.md#%E8%B4%A6%E5%8F%B7%E6%B1%A0%E9%85%8D%E7%BD%AE%E5%8F%82%E8%80%83),配置后不需要额外设置mj.discord |
6-
| mj.discord.guild-id || discord服务器ID |
7-
| mj.discord.channel-id || discord频道ID |
8-
| mj.discord.user-token || discord用户Token |
9-
| mj.discord.session-id || discord用户SessionId,建议从interactions请求中复制替换掉 |
10-
| mj.discord.user-agent || 调用discord接口、连接wss时的user-agent,建议从浏览器network复制 |
11-
| mj.discord.remix || 是否启用了remix,默认false。与账号的Remix模式开关保持一致 |
5+
| mj.accounts || 参考 [账号池配置](./config.md#%E8%B4%A6%E5%8F%B7%E6%B1%A0%E9%85%8D%E7%BD%AE%E5%8F%82%E8%80%83),配置后不需要额外设置mj.discord |
6+
| mj.account-store-type || 账号存储方式,默认in_memory(内存\重启后丢失),可选redis |
7+
| mj.account-choose-rule || 账号选择策略:默认 BestWaitIdleRule(最少等待空闲)、RoundRobinRule(轮循) |
128
| mj.api-secret || 接口密钥,为空不启用鉴权;调用接口时需要加请求头 mj-api-secret |
9+
| mj.task-store.type || 任务存储方式,默认in_memory(内存\重启后丢失),可选redis |
10+
| mj.task-store.timeout || 任务存储过期时间,过期后删除,默认30天 |
1311
| mj.notify-hook || 全局的任务状态变更回调地址 |
1412
| mj.notify-notify-pool-size || 通知回调线程池大小,默认10 |
15-
| mj.task-store.type || 任务存储方式,默认in_memory(内存\重启后丢失),可选redis |
16-
| mj.task-store.timeout || 任务过期时间,过期后删除,默认30天 |
17-
| mj.queue.core-size || 并发数,默认为3 |
18-
| mj.queue.queue-size || 等待队列,默认长度10 |
19-
| mj.queue.timeout-minutes || 任务超时时间,默认为5分钟 |
2013
| mj.proxy.host || 代理host,全局代理不生效时设置 |
2114
| mj.proxy.port || 代理port,全局代理不生效时设置 |
2215
| mj.ng-discord.server || https://discord.com 反代地址 |
@@ -34,10 +27,9 @@
3427
| mj.openai.temperature || 相似度(0-2.0),默认0 |
3528
| mj.deepl-translate.auth-key || DEEPL翻译的鉴权密钥 |
3629
| mj.error-desc || 任务错误原因转换,默认使用mj提供的英文描述 |
37-
| spring.redis || 任务存储方式设置为redis,需配置redis相关属性 |
30+
| spring.redis || 存储方式设置为redis,需配置redis相关属性 |
3831

3932
### 账号池配置参考
40-
设置账号池后,调整`mj.queue`以实现更多任务并发
4133
```yaml
4234
mj:
4335
accounts:
@@ -46,14 +38,25 @@ mj:
4638
user-token: xxxx
4739
session-id: xxxx
4840
user-agent: xxxx
49-
remix: false
5041
- guild-id: xxx
5142
channel-id: xxx
5243
user-token: xxxx
5344
session-id: xxxx
5445
user-agent: xxxx
55-
remix: false
5646
```
47+
账号字段说明
48+
49+
| 名称 | 非空 | 描述 |
50+
| :-----| :----: | :---- |
51+
| guild-id | 是 | discord服务器ID |
52+
| channel-id | 是 | discord频道ID |
53+
| user-token | 是 | discord用户Token |
54+
| session-id | 否 | discord用户SessionId,建议从interactions请求中复制替换掉 |
55+
| user-agent | 否 | 调用discord接口、连接wss时的user-agent,建议从浏览器network复制 |
56+
| enable | 否 | 是否可用,默认true |
57+
| core-size | 否 | 并发数,默认3 |
58+
| queue-size | 否 | 等待队列长度,默认10 |
59+
| timeout-minutes | 否 | 任务超时时间(分钟),默认5 |
5760
5861
### spring.redis配置参考
5962
```yaml

docs/start.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
## 部署教程
22

33
### Docker
4+
45
1. /xxx/xxx/config目录下创建 application.yml(mj配置项)、banned-words.txt(可选,覆盖默认的敏感词文件);参考resources下的文件
6+
> 注意: /xxx/xxx是 服务器目录示例,需自行修改
57
2. 启动容器,映射config目录
68
```shell
79
docker run -d --name midjourney-proxy \
810
-p 8080:8080 \
911
-v /xxx/xxx/config:/home/spring/config \
10-
novicezk/midjourney-proxy-pilot:3.0.5
12+
novicezk/midjourney-proxy-pilot:3.1
1113
```
1214
3. 访问 `http://ip:port/mj` 查看API文档
1315
4. 在API文档页获取机器码,联系作者获取激活码,激活服务
@@ -19,5 +21,5 @@ docker run -d --name midjourney-proxy \
1921
-e mj.accounts[0].guild-id=xxx \
2022
-e mj.accounts[0].channel-id=xxx \
2123
-e mj.accounts[0].user-token=xxx \
22-
novicezk/midjourney-proxy-pilot:3.0.5
24+
novicezk/midjourney-proxy-pilot:3.1
2325
```

resources/application.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
mj:
2+
account-store-type: in_memory
23
accounts:
34
- guild-id: xxx
45
channel-id: xxx
56
user-token: xxx
67
session-id: 9c4055428e13bcbf2248a6b36084c5f3
78
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
8-
remix: false
9+
core-size: 3
10+
queue-size: 10
11+
timeout-minutes: 5
912
task-store:
1013
type: in_memory
1114
timeout: 30d
1215
translate-way: null
1316
translate-zh-way: null
14-
queue:
15-
timeout-minutes: 5
16-
core-size: 3
17-
queue-size: 10
1817
error-desc:
1918
- en: "against our community standards"
2019
zh: "可能包含违规信息"

0 commit comments

Comments
 (0)