From ea04e6bcc53e38e0f8f2776d12daadf67e32de52 Mon Sep 17 00:00:00 2001 From: CaIon <1808837298@qq.com> Date: Wed, 14 May 2025 17:01:50 +0800 Subject: [PATCH] fix: update model selection logic for image edits in distributor middleware --- middleware/distributor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/distributor.go b/middleware/distributor.go index 34882381..755a477d 100644 --- a/middleware/distributor.go +++ b/middleware/distributor.go @@ -185,7 +185,7 @@ func getModelRequest(c *gin.Context) (*ModelRequest, bool, error) { if strings.HasPrefix(c.Request.URL.Path, "/v1/images/generations") { modelRequest.Model = common.GetStringIfEmpty(modelRequest.Model, "dall-e") } else if strings.HasPrefix(c.Request.URL.Path, "/v1/images/edits") { - modelRequest.Model = common.GetStringIfEmpty(modelRequest.Model, "gpt-image-1") + modelRequest.Model = common.GetStringIfEmpty(c.PostForm("model"), "gpt-image-1") } if strings.HasPrefix(c.Request.URL.Path, "/v1/audio") { relayMode := relayconstant.RelayModeAudioSpeech