Merge pull request #3526 from feitianbubu/pr/e560265b6e57aa7b95bc98cb53397ef0a3082d9d

支持wan2.7生图-wan2.7-image
This commit is contained in:
Calcium-Ion 2026-04-02 00:15:04 +08:00 committed by GitHub
commit 7efb1922fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 7 deletions

View File

@ -171,12 +171,17 @@ type AliImageRequest struct {
} }
type AliImageParameters struct { type AliImageParameters struct {
Size string `json:"size,omitempty"` Size string `json:"size,omitempty"`
N int `json:"n,omitempty"` N int `json:"n,omitempty"`
Steps string `json:"steps,omitempty"` Steps string `json:"steps,omitempty"`
Scale string `json:"scale,omitempty"` Scale string `json:"scale,omitempty"`
Watermark *bool `json:"watermark,omitempty"` Watermark *bool `json:"watermark,omitempty"`
PromptExtend *bool `json:"prompt_extend,omitempty"` PromptExtend *bool `json:"prompt_extend,omitempty"`
ThinkingMode *bool `json:"thinking_mode,omitempty"`
EnableSequential *bool `json:"enable_sequential,omitempty"`
BboxList any `json:"bbox_list,omitempty"`
ColorPalette any `json:"color_palette,omitempty"`
Seed *int `json:"seed,omitempty"`
} }
func (p *AliImageParameters) PromptExtendValue() bool { func (p *AliImageParameters) PromptExtendValue() bool {

View File

@ -180,6 +180,7 @@ func oaiFormEdit2AliImageEdit(c *gin.Context, info *relaycommon.RelayInfo, reque
}, },
} }
imageRequest.Parameters = AliImageParameters{ imageRequest.Parameters = AliImageParameters{
N: int(lo.FromPtrOr(request.N, uint(1))),
Watermark: request.Watermark, Watermark: request.Watermark,
} }
return &imageRequest, nil return &imageRequest, nil

View File

@ -40,7 +40,8 @@ func oaiFormEdit2WanxImageEdit(c *gin.Context, info *relaycommon.RelayInfo, requ
} }
func isOldWanModel(modelName string) bool { func isOldWanModel(modelName string) bool {
return strings.Contains(modelName, "wan") && !strings.Contains(modelName, "wan2.6") return strings.Contains(modelName, "wan") &&
!lo.SomeBy([]string{"wan2.6", "wan2.7"}, func(v string) bool { return strings.Contains(modelName, v) })
} }
func isWanModel(modelName string) bool { func isWanModel(modelName string) bool {

View File

@ -17,6 +17,7 @@ var defaultQwenSettings = QwenSettings{
"z-image", "z-image",
"qwen-image", "qwen-image",
"wan2.6", "wan2.6",
"wan2.7",
"qwen-image-edit", "qwen-image-edit",
"qwen-image-edit-max", "qwen-image-edit-max",
"qwen-image-edit-max-2026-01-16", "qwen-image-edit-max-2026-01-16",