feat: reset image num to 1 when not given (#821)
* Update relay-image.go * fix: reset image num to 1 when not given --------- Co-authored-by: JustSong <songquanpeng@foxmail.com>
This commit is contained in:
parent
6acb9537a9
commit
66f06e5d6f
@ -19,7 +19,6 @@ func isWithinRange(element string, value int) bool {
|
|||||||
if _, ok := common.DalleGenerationImageAmounts[element]; !ok {
|
if _, ok := common.DalleGenerationImageAmounts[element]; !ok {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
min := common.DalleGenerationImageAmounts[element][0]
|
min := common.DalleGenerationImageAmounts[element][0]
|
||||||
max := common.DalleGenerationImageAmounts[element][1]
|
max := common.DalleGenerationImageAmounts[element][1]
|
||||||
|
|
||||||
@ -42,6 +41,10 @@ func relayImageHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode
|
|||||||
return errorWrapper(err, "bind_request_body_failed", http.StatusBadRequest)
|
return errorWrapper(err, "bind_request_body_failed", http.StatusBadRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if imageRequest.N == 0 {
|
||||||
|
imageRequest.N = 1
|
||||||
|
}
|
||||||
|
|
||||||
// Size validation
|
// Size validation
|
||||||
if imageRequest.Size != "" {
|
if imageRequest.Size != "" {
|
||||||
imageSize = imageRequest.Size
|
imageSize = imageRequest.Size
|
||||||
|
Loading…
Reference in New Issue
Block a user