diff --git a/utils/dalle.js b/utils/dalle.js index 02d1312..0b627fa 100644 --- a/utils/dalle.js +++ b/utils/dalle.js @@ -23,6 +23,9 @@ export async function createImage (prompt, n = 1, size = '512x512') { // 如果配了proxy,而且有反代,但是没开启强制反代 basePath = defaultOpenAIReverseProxy } + if (!Config.openAiBaseUrl) { + basePath = defaultOpenAIReverseProxy + } const configuration = new Configuration({ apiKey: Config.apiKey, basePath: basePath + '/v1' @@ -50,6 +53,9 @@ export async function imageVariation (imageUrl, n = 1, size = '512x512') { // 如果配了proxy,而且有反代,但是没开启强制反代 basePath = defaultOpenAIReverseProxy } + if (!Config.openAiBaseUrl) { + basePath = defaultOpenAIReverseProxy + } const configuration = new Configuration({ apiKey: Config.apiKey, basePath: basePath + '/v1' @@ -124,6 +130,9 @@ export async function editImage (originalImage, mask = [], prompt, num = 1, size // 如果配了proxy,而且有反代,但是没开启强制反代 basePath = defaultOpenAIReverseProxy } + if (!Config.openAiBaseUrl) { + basePath = defaultOpenAIReverseProxy + } const configuration = new Configuration({ apiKey: Config.apiKey, basePath: basePath + '/v1'