forked from QuantumNous/new-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqwen.go
More file actions
51 lines (43 loc) · 1.01 KB
/
Copy pathqwen.go
File metadata and controls
51 lines (43 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package model_setting
import (
"strings"
"github.com/QuantumNous/new-api/setting/config"
)
// QwenSettings defines Qwen model configuration. 注意bool要以enabled结尾才可以生效编辑
type QwenSettings struct {
SyncImageModels []string `json:"sync_image_models"`
}
// 默认配置
var defaultQwenSettings = QwenSettings{
SyncImageModels: []string{
"z-image",
"qwen-image",
"wan2.6",
"wan2.7",
"qwen-image-edit",
"qwen-image-edit-max",
"qwen-image-edit-max-2026-01-16",
"qwen-image-edit-plus",
"qwen-image-edit-plus-2025-12-15",
"qwen-image-edit-plus-2025-10-30",
},
}
// 全局实例
var qwenSettings = defaultQwenSettings
func init() {
// 注册到全局配置管理器
config.GlobalConfig.Register("qwen", &qwenSettings)
}
// GetQwenSettings
func GetQwenSettings() *QwenSettings {
return &qwenSettings
}
// IsSyncImageModel
func IsSyncImageModel(model string) bool {
for _, m := range qwenSettings.SyncImageModels {
if strings.Contains(model, m) {
return true
}
}
return false
}