Skip to content

Commit a098d03

Browse files
feat: update NEAR AI image generation
1 parent a6da6c1 commit a098d03

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/core/src/generation.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -2116,18 +2116,21 @@ export const generateImage = async (
21162116
if (
21172117
targetSize !== "1024x1024" &&
21182118
targetSize !== "1792x1024" &&
2119-
targetSize !== "1024x1792"
2119+
targetSize !== "1024x1792" &&
2120+
targetSize !== "512x512" &&
2121+
targetSize !== "256x256"
21202122
) {
21212123
targetSize = "1024x1024";
21222124
}
2125+
// NEAR AI uses OpenAI compatible API
21232126
const openai = new OpenAI({
2124-
baseURL: settings.NEARAI_API_URL || "https://api.near.ai/v1",
2127+
baseURL: getEndpoint(ModelProviderName.NEARAI),
21252128
apiKey,
21262129
});
21272130
const response = await openai.images.generate({
21282131
model,
21292132
prompt: data.prompt,
2130-
size: targetSize as "1024x1024" | "1792x1024" | "1024x1792",
2133+
size: targetSize as "1024x1024" | "1792x1024" | "1024x1792" | "512x512" | "256x256",
21312134
n: data.count,
21322135
response_format: "b64_json",
21332136
});

0 commit comments

Comments
 (0)