fix(provider): 火山方舟图片 - 避免结果下载重复计费
集成 PR #256,保留原 PR 开发者为提交作者。
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- 火山方舟 Seedream 图片生成显式关闭“AI 生成”水印,并由后端下载方舟 CDN 结果后写入服务器或对象存储,恢复素材库自动入库。
|
||||
- 火山方舟 Seedream 图片生成显式关闭“AI 生成”水印,并要求生成响应直接返回 Base64 后写入服务器或对象存储,避免为持久化结果再次请求方舟 CDN;中转服务忽略返回格式时仍保留 URL 下载兼容。
|
||||
- 项目开源协议由 AGPL-3.0 调整为 MIT,保留上游及项目贡献者版权声明。
|
||||
- 修复任务中心等资源入口仍由应用服务器转发对象存储媒体的问题:配置 CDN 加速域名后,登录资源、公开画布分享和管理员媒体预览统一重定向到 CDN;内部 Blob 读取保留同源代理兼容。
|
||||
|
||||
|
||||
@@ -1067,10 +1067,11 @@ func volcengineArkImageDataURLs(ctx context.Context, config providerConfig, payl
|
||||
|
||||
func volcengineArkImageBody(input canvasGenerationInput) (map[string]interface{}, error) {
|
||||
body := map[string]interface{}{
|
||||
"model": input.Config.Model,
|
||||
"prompt": withSystemPrompt(input.Config, input.Prompt),
|
||||
"n": 1,
|
||||
"watermark": false,
|
||||
"model": input.Config.Model,
|
||||
"prompt": withSystemPrompt(input.Config, input.Prompt),
|
||||
"n": 1,
|
||||
"response_format": "b64_json",
|
||||
"watermark": false,
|
||||
}
|
||||
if key, value := imageSizeParameter(input.ImageCapability, input.Config.Size); value != "" {
|
||||
if key == "size" {
|
||||
|
||||
@@ -180,6 +180,9 @@ func TestVolcengineArkImageBodyUsesJSONReferencesAndDownscalesSize(t *testing.T)
|
||||
if watermark, ok := body["watermark"].(bool); !ok || watermark {
|
||||
t.Fatalf("watermark = %#v, want false", body["watermark"])
|
||||
}
|
||||
if responseFormat, _ := body["response_format"].(string); responseFormat != "b64_json" {
|
||||
t.Fatalf("response_format = %#v, want b64_json", body["response_format"])
|
||||
}
|
||||
size, _ := body["size"].(string)
|
||||
parts := strings.Split(size, "x")
|
||||
if len(parts) != 2 {
|
||||
|
||||
@@ -919,6 +919,7 @@ export async function requestGeneration(config: AiConfig, prompt: string, option
|
||||
model: requestConfig.model,
|
||||
prompt: withSystemPrompt(requestConfig, prompt),
|
||||
n,
|
||||
response_format: "b64_json",
|
||||
watermark: false,
|
||||
...(normalizedRequestSize ? { [normalizedRequestSize.parameter]: normalizedRequestSize.value } : {}),
|
||||
}
|
||||
@@ -1014,6 +1015,7 @@ export async function requestEdit(config: AiConfig, prompt: string, references:
|
||||
model: requestConfig.model,
|
||||
prompt: withSystemPrompt(requestConfig, requestPrompt),
|
||||
n,
|
||||
response_format: "b64_json",
|
||||
watermark: false,
|
||||
...(requestSize ? { [requestSize.parameter]: requestSize.value } : {}),
|
||||
...(images.length === 1 ? { image: images[0] } : images.length > 1 ? { image: images } : {}),
|
||||
|
||||
Reference in New Issue
Block a user