diff --git a/backend/services/assetService/service/minimax_service.go b/backend/services/assetService/service/minimax_service.go index eafa386..2a14bf3 100644 --- a/backend/services/assetService/service/minimax_service.go +++ b/backend/services/assetService/service/minimax_service.go @@ -14,6 +14,7 @@ import ( "net" "net/http" "net/url" + "os" "strings" "sync" "time" @@ -175,8 +176,8 @@ func (s *minimaxService) processJob(job *ImageGenerationJob) { // callMiniMaxAPI 调用 MiniMax API func (s *minimaxService) callMiniMaxAPI(model, prompt, aspectRatio string, refs []dto.SubjectReference, n int) ([]string, error) { - apiURL := s.config.GetMiniMaxAPIURL() - apiKey := s.config.GetMiniMaxAPIKey() + apiURL := os.Getenv("MINIMAX_API_URL") + apiKey := os.Getenv("MINIMAX_API_KEY") payload := map[string]interface{}{ "model": model, @@ -260,7 +261,7 @@ func (s *minimaxService) compressImageIfNeeded(imageURL string) (string, error) return "data:image/jpeg;base64," + base64.StdEncoding.EncodeToString(imgData), nil } - resized := resize.Thumbnail(newWidth, newHeight, img, resize.Lanczos) + resized := resize.Thumbnail(newWidth, newHeight, img, resize.Lanczos3) var buf bytes.Buffer switch format {