Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support Ali stable-diffusion-xl and wanx-v1 model #1240

Merged
merged 6 commits into from
Apr 5, 2024

Conversation

mo2g
Copy link
Contributor

@mo2g mo2g commented Mar 28, 2024

close #1240

我已确认该 PR 已自测通过,相关截图如下:
image

image

@mo2g mo2g changed the title Fix ali ConvertRequest function to use baidu keyword Support Ali stable-diffusion-xl and wanx-v1 model Mar 29, 2024
@mo2g mo2g changed the title Support Ali stable-diffusion-xl and wanx-v1 model feat: Support Ali stable-diffusion-xl and wanx-v1 model Mar 29, 2024
@songquanpeng songquanpeng added the priority This will have high priority. label Mar 30, 2024
@songquanpeng
Copy link
Owner

改动有点多,我需要处理一段时间哈

@mo2g
Copy link
Contributor Author

mo2g commented Mar 30, 2024

好的,我理解。感谢您的时间和努力。如果有任何需要我协助的地方,请随时告诉我。

@songquanpeng songquanpeng changed the title feat: Support Ali stable-diffusion-xl and wanx-v1 model feat: support Ali stable-diffusion-xl and wanx-v1 model Apr 5, 2024
@songquanpeng songquanpeng merged commit d4347e7 into songquanpeng:main Apr 5, 2024
@songquanpeng
Copy link
Owner

Thx~

@mlkt
Copy link

mlkt commented May 25, 2024

@mo2g 希望能看一下这个问题
#1467

@mo2g
Copy link
Contributor Author

mo2g commented May 25, 2024

@mo2g 希望能看一下这个问题 #1467

合并代码的时候 stable-diffusion-xl 被改成了 ali-stable-diffusion-xl ,可能是为了方便跟 baidu 的stable-diffusion-xl区分开,我看看怎么做兼容处理。

@mlkt
Copy link

mlkt commented May 25, 2024

@mo2g
image
我刚刚自己改了一下

imageRequest.Model = strings.TrimPrefix(request.Model, "ali-")

@mlkt
Copy link

mlkt commented May 25, 2024

还有我发现 wanx-v1 报错是因为

responseFormat := c.GetString("response_format")

这句获取的根本就不是请求里的参数,所以就算请求里指定了 "b64_json" 也没用,仍然返回了url而不是base64,导致open-webui无法识别

image

@mlkt
Copy link

mlkt commented May 25, 2024

还有我发现 wanx-v1 报错是因为

responseFormat := c.GetString("response_format")

这句获取的根本就不是请求里的参数,所以就算请求里指定了 "b64_json" 也没用,仍然返回了url而不是base64,导致open-webui无法识别

image

这个问题以及找不到模型的问题修复:
#1470

@mo2g
Copy link
Contributor Author

mo2g commented May 26, 2024

@mlkt 感谢你的反馈,这个 PR 确实存在一些疏漏。

  1. 去掉 ali 前缀也是一个方案。只是需要考虑以后还会有 baidu-stable-diffusion-xl 、tencent-stable-diffusion-xl 等其他厂家的模型,这就需要去对应的模块单独处理,需要权衡一下怎样方便维护。
  2. 确实是,我提交代码的时候漏了一句,导致获取不到 response_format,采用了默认的 url 格式
c.Set("response_format", imageRequest.ResponseFormat)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority This will have high priority.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants