Skip to content

Commit 66cda90

Browse files
author
zhukai
committed
feat: 支持局部重绘
1 parent 1d12213 commit 66cda90

File tree

6 files changed

+16
-32
lines changed

6 files changed

+16
-32
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
## 先行版功能
1717
- [x] 支持开源版的所有功能
18-
- [x] 支持U之后的所有相关动作:Zoom(图片变焦)、Pan(焦点移动) 等
19-
- [x] 支持 Blend(图片混合) 指令和相关动作
20-
- [x] 支持 Describe(图生文) 指令和相关动作
21-
- [x] 支持 Shorten 指令和相关动作
22-
- [x] 支持 Remix 模式,参考 [API接口说明](./docs/api.md)`/mj/submit/action`
18+
- [x] 支持 Shorten(prompt分析) 指令
19+
- [x] 支持焦点移动: Pan ⬅️ ➡️ ⬆️ ⬇️
20+
- [x] 支持图片变焦: Zoom 🔍
21+
- [x] 支持局部重绘: Vary (Region) 🖌
22+
- [x] 支持几乎所有的关联按钮动作和🎛️ Remix模式,参考 [API接口说明](./docs/api.md)`/mj/submit/action`
2323
- [x] 支持获取图片的seed值
2424
- [x] 中英文翻译额外支持deepl
2525
- [x] 账号池持久化,动态维护
@@ -28,8 +28,8 @@
2828
- [x] 内嵌 [管理后台页面](https://github.com/litter-coder/midjourney-proxy-admin)
2929

3030
## 后续计划
31-
3231
- [ ] 任务、账号存储支持MySQL
32+
- [ ] 取消执行中或排队的任务
3333
- [ ] settings设置
3434

3535
## 获取方式

docs/api.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# API接口说明
22

3-
`http://ip:port/doc` 已有api文档,此处仅作补充
3+
`http://ip:port/mj` 已有api文档,此处仅作补充
44

55
## 1. 数据结构
66

77
### 任务
88
| 字段 | 类型 | 示例 | 描述 |
99
|:-----:|:----:|:----|:----|
1010
| id | string | 1689231405853400 | 任务ID |
11-
| action | string | IMAGINE | 任务类型: IMAGINE(绘图)、UPSCALE(选中放大)、VARIATION(选中变换)、ZOOM(图片变焦)、PAN(焦点移动)、DESCRIBE(图生文)、BLEAND(图片混合)、SHORTEN(prompt分析) |
11+
| action | string | IMAGINE | 任务类型: IMAGINE(绘图)、UPSCALE(放大)、VARIATION(变化)、ZOOM(图片变焦)、PAN(焦点移动)、DESCRIBE(图生文)、BLEND(图片混合)、SHORTEN(prompt分析) |
1212
| status | string | SUCCESS | 任务状态: NOT_START(未启动)、SUBMITTED(已提交处理)、MODAL(窗口等待)、IN_PROGRESS(执行中)、FAILURE(失败)、SUCCESS(成功) |
1313
| prompt | string | 猫猫 | 提示词 |
1414
| promptEn | string | Cat | 英文提示词 |
@@ -94,6 +94,7 @@
9494
```
9595
⚠️ 注意: 某些场景需要modal弹框确认
9696
- 执行CustomZoom(自定义变焦)
97+
- 执行️Region(局部重绘)
9798
- 执行PicReader(Describe后选择生图)
9899
- 执行PromptAnalyzer(Shorten后选择生图)
99100
- 账号开启了Remix & 执行Reroll、Variation、Pan
@@ -115,13 +116,14 @@
115116
"prompt": "Cat"
116117
}
117118
```
118-
CustomZoom的prompt需要设置`--zoom`(1到2之间),例如: `Cat --zoom 1.5`
119+
- CustomZoom的prompt需要设置`--zoom`(1到2之间),例如: `Cat --zoom 1.5`
120+
- ️Vary (Region) 需要额外传`maskBase64`: 局部重绘的蒙版base64(底色纯黑,选中区域纯白)
119121

120122
## 4. `/mj/submit/describe` 图生文
121123
```json
122124
{
123-
// 图片的base64字符串
124-
"base64": "data:image/png;base64,xxx"
125+
// 图片的base64字符串
126+
"base64": "data:image/png;base64,xxx"
125127
}
126128
```
127129

docs/config.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,11 @@ mj:
3939
channel-id: xxx
4040
user-token: xxxx
4141
mj-bot-channel-id: xxxx
42-
session-id: xxxx
4342
user-agent: xxxx
4443
- guild-id: xxx
4544
channel-id: xxx
4645
user-token: xxxx
4746
mj-bot-channel-id: xxxx
48-
session-id: xxxx
4947
user-agent: xxxx
5048
```
5149
账号字段说明
@@ -56,7 +54,6 @@ mj:
5654
| channel-id | 是 | discord频道ID |
5755
| user-token | 是 | discord用户Token |
5856
| mj-bot-channel-id | 否 | Midjourney Bot私信ID |
59-
| session-id | 否 | discord用户SessionId,建议从interactions请求中复制替换掉 |
6057
| user-agent | 否 | 调用discord接口、连接wss时的user-agent,建议从浏览器network复制 |
6158
| enable | 否 | 是否可用,默认true |
6259
| core-size | 否 | 并发数,默认3 |

docs/discord-params.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,12 @@
77

88
![User Token](params_user.png)
99

10-
### 2. 获取用户sessionId
11-
进入频道,打开network,发送/imagine作图指令,找到 `interactions` 的请求,这里的 session_id 即用户sessionId,后续设置到 `session-id`
12-
13-
![User Session](params_session_id.png)
14-
15-
### 3. 获取服务器ID、频道ID
10+
### 2. 获取服务器ID、频道ID
1611

1712
频道的url里取出 服务器ID、频道ID,后续设置到账号的 `guild-id``channel-id`
1813
![Guild Channel ID](img_9.png)
1914

20-
### 4. 获取MJ私信ID
15+
### 3. 获取MJ私信ID
2116

22-
url里取出 私信ID,后续设置到账号的 `mj-bot-channel-id`,获取图片seed功能需要用到
17+
url里取出 私信ID,后续设置到账号的 `mj-bot-channel-id`
2318
![Midjourney @me](bot-me.png)

docs/params_session_id.png

-181 KB
Binary file not shown.

resources/application.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
mj:
22
account-store-type: in_memory
3-
accounts:
4-
- guild-id: xxx
5-
channel-id: xxx
6-
user-token: xxx
7-
mj-bot-channel-id: xxx
8-
session-id: 9c4055428e13bcbf2248a6b36084c5f3
9-
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
10-
core-size: 3
11-
queue-size: 10
12-
timeout-minutes: 5
133
task-store:
144
type: in_memory
155
timeout: 30d

0 commit comments

Comments
 (0)