feat: stable diffusion image drawing on mobile is ready

This commit is contained in:
RockYang
2024-04-03 18:13:48 +08:00
parent 9b7ee538c4
commit 0355c37bef
19 changed files with 1457 additions and 545 deletions

View File

@@ -22,8 +22,12 @@ func NewProxyClient(config types.MjProxyConfig) *ProxyClient {
func (c *ProxyClient) Imagine(task types.MjTask) (ImageRes, error) {
apiURL := fmt.Sprintf("%s/mj/submit/imagine", c.apiURL)
prompt := fmt.Sprintf("%s %s", task.Prompt, task.Params)
if task.NegPrompt != "" {
prompt += fmt.Sprintf(" --no %s", task.NegPrompt)
}
body := ImageReq{
Prompt: fmt.Sprintf("%s %s", task.Prompt, task.Params),
Prompt: prompt,
Base64Array: make([]string, 0),
}
// 生成图片 Base64 编码