add stable diffusion default negtive prompt system config

This commit is contained in:
RockYang
2024-05-07 16:21:31 +08:00
parent 8a8c43c7a5
commit 6424eb871c
8 changed files with 271 additions and 237 deletions

View File

@@ -175,4 +175,6 @@ type SystemConfig struct {
EnableContext bool `json:"enable_context,omitempty"`
ContextDeep int `json:"context_deep,omitempty"`
SdNegPrompt string `json:"sd_neg_prompt"` // SD 默认反向提示词
}

View File

@@ -83,7 +83,7 @@ func (h *ChatHandler) sendXunFeiMessage(
res = h.DB.Where("id", session.Model.KeyId).Where("enabled", true).Find(&apiKey)
}
// use the last unused key
if res.Error != nil {
if apiKey.Id == 0 {
res = h.DB.Where("platform", session.Model.Platform).Where("type", "chat").Where("enabled", true).Order("last_used_at ASC").First(&apiKey)
}
if res.Error != nil {

View File

@@ -47,9 +47,9 @@ func NewLicenseService(server *core.AppServer, levelDB *store.LevelDB) *LicenseS
type License struct {
Name string `json:"name"`
License string `json:"license"`
Mid string `json:"mid"`
ActiveAt int64 `json:"active_at"`
License string `json:"license"`
MachineId string `json:"mid"`
ActiveAt int64 `json:"active_at"`
ExpiredAt int64 `json:"expired_at"`
UserNum int `json:"user_num"`
}
@@ -139,7 +139,7 @@ func (s *LicenseService) fetchLicense() (*types.License, error) {
return &types.License{
Key: res.Data.License,
MachineId: res.Data.Mid,
MachineId: res.Data.MachineId,
UserNum: res.Data.UserNum,
ExpiredAt: res.Data.ExpiredAt,
IsActive: true,

View File

@@ -58,6 +58,7 @@ func NewServicePool(db *gorm.DB, redisCli *redis.Client, manager *oss.UploaderMa
services = append(services, plusService)
}
// for mid-journey proxy
for k, config := range appConfig.MjProxyConfigs {
if config.Enabled == false {
continue