venice_upscale_image
Increase image resolution and quality using AI upscaling. Upload an image and specify the scale factor to enhance details and clarity.
Instructions
Upscale an image using Venice AI
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | Base64-encoded image data or URL | |
| scale | No | Upscale factor (2, 4, etc.) |
Implementation Reference
- src/tools/inference/index.ts:92-97 (handler)The asynchronous handler function that performs the image upscaling by calling the Venice API endpoint /images/upscale with the provided image and scale parameters, handles errors, and returns the upscaled image URL.async ({ image, scale }) => { const response = await veniceAPI("/images/upscale", { method: "POST", body: JSON.stringify({ image, scale }) }); const data = await response.json() as ImageUpscaleResponse; if (!response.ok) return { content: [{ type: "text" as const, text: `Error: ${data.error?.message || response.statusText}` }] }; return { content: [{ type: "text" as const, text: data.data?.url ? `Upscaled: ${data.data.url}` : "Image upscaled" }] }; }
- src/tools/inference/index.ts:89-91 (schema)Zod schema defining the input parameters for the tool: image as base64 or URL string, and optional scale factor (default 2).image: z.string().describe("Base64-encoded image data or URL"), scale: z.number().optional().default(2).describe("Upscale factor (2, 4, etc.)"), },
- src/tools/inference/index.ts:85-98 (registration)Registration of the venice_upscale_image tool on the MCP server, including name, description, input schema, and handler function.server.tool( "venice_upscale_image", "Upscale an image using Venice AI", { image: z.string().describe("Base64-encoded image data or URL"), scale: z.number().optional().default(2).describe("Upscale factor (2, 4, etc.)"), }, async ({ image, scale }) => { const response = await veniceAPI("/images/upscale", { method: "POST", body: JSON.stringify({ image, scale }) }); const data = await response.json() as ImageUpscaleResponse; if (!response.ok) return { content: [{ type: "text" as const, text: `Error: ${data.error?.message || response.statusText}` }] }; return { content: [{ type: "text" as const, text: data.data?.url ? `Upscaled: ${data.data.url}` : "Image upscaled" }] }; } );