feat(image-processor): switch to OpenRouter Vision for smart crop and remove heavy models
This commit is contained in:
@@ -35,11 +35,9 @@ fastify.get("/process", async (request, reply) => {
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) {
|
||||
return reply
|
||||
.status(response.status)
|
||||
.send({
|
||||
error: `Failed to fetch source image: ${response.statusText}`,
|
||||
});
|
||||
return reply.status(response.status).send({
|
||||
error: `Failed to fetch source image: ${response.statusText}`,
|
||||
});
|
||||
}
|
||||
|
||||
const arrayBuffer = await response.arrayBuffer();
|
||||
@@ -50,6 +48,7 @@ fastify.get("/process", async (request, reply) => {
|
||||
height,
|
||||
format,
|
||||
quality,
|
||||
openRouterApiKey: process.env.OPENROUTER_API_KEY,
|
||||
});
|
||||
|
||||
reply.header("Content-Type", `image/${format}`);
|
||||
|
||||
Reference in New Issue
Block a user