feat: update model lists and adjust quota calculation logic

⚠️breaking change warning: for image models, the model ratio represents the quota cost per image
This commit is contained in:
Laisky.Cai
2025-03-16 02:01:44 +00:00
parent f3300f08e2
commit fa794e7bd5
4 changed files with 258 additions and 197 deletions

View File

@@ -193,9 +193,9 @@ func RelayImageHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatus
switch meta.ChannelType {
case channeltype.Replicate:
// replicate always return 1 image
quota = int64(ratio * imageCostRatio * 1000)
quota = int64(ratio * imageCostRatio)
default:
quota = int64(ratio*imageCostRatio*1000) * int64(imageRequest.N)
quota = int64(ratio*imageCostRatio) * int64(imageRequest.N)
}
if userQuota-quota < 0 {