feat: support midjourney --cref and --sref for role consistency

This commit is contained in:
RockYang
2024-04-02 14:59:53 +08:00
parent fbb216fe3b
commit da14309ef9
10 changed files with 247 additions and 53 deletions

View File

@@ -23,7 +23,7 @@ func NewProxyClient(config types.MjProxyConfig) *ProxyClient {
func (c *ProxyClient) Imagine(task types.MjTask) (ImageRes, error) {
apiURL := fmt.Sprintf("%s/mj/submit/imagine", c.apiURL)
body := ImageReq{
Prompt: task.Prompt,
Prompt: fmt.Sprintf("%s %s", task.Prompt, task.Params),
Base64Array: make([]string, 0),
}
// 生成图片 Base64 编码
@@ -46,8 +46,6 @@ func (c *ProxyClient) Imagine(task types.MjTask) (ImageRes, error) {
SetErrorResult(&errRes).
Post(apiURL)
if err != nil {
all, err := io.ReadAll(r.Body)
logger.Info(string(all))
return ImageRes{}, fmt.Errorf("请求 API %s 出错:%v", apiURL, err)
}