File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -2116,18 +2116,21 @@ export const generateImage = async (
2116
2116
if (
2117
2117
targetSize !== "1024x1024" &&
2118
2118
targetSize !== "1792x1024" &&
2119
- targetSize !== "1024x1792"
2119
+ targetSize !== "1024x1792" &&
2120
+ targetSize !== "512x512" &&
2121
+ targetSize !== "256x256"
2120
2122
) {
2121
2123
targetSize = "1024x1024" ;
2122
2124
}
2125
+ // NEAR AI uses OpenAI compatible API
2123
2126
const openai = new OpenAI ( {
2124
- baseURL : settings . NEARAI_API_URL || "https://api.near.ai/v1" ,
2127
+ baseURL : getEndpoint ( ModelProviderName . NEARAI ) ,
2125
2128
apiKey,
2126
2129
} ) ;
2127
2130
const response = await openai . images . generate ( {
2128
2131
model,
2129
2132
prompt : data . prompt ,
2130
- size : targetSize as "1024x1024" | "1792x1024" | "1024x1792" ,
2133
+ size : targetSize as "1024x1024" | "1792x1024" | "1024x1792" | "512x512" | "256x256" ,
2131
2134
n : data . count ,
2132
2135
response_format : "b64_json" ,
2133
2136
} ) ;
You can’t perform that action at this time.
0 commit comments