runway_upscaleVideo
Increase video resolution to enhance quality and clarity for improved viewing experience. Upload your video URL to upscale it to higher definition.
Instructions
Upscale a video to a higher resolution. videoUri takes in a url of a video or a data uri of a video.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| videoUri | Yes |
Implementation Reference
- src/index.ts:141-152 (registration)Registration of the 'runway_upscaleVideo' tool using server.tool(), specifying name, description, input schema, and handler function.server.tool( "runway_upscaleVideo", "Upscale a video to a higher resolution. videoUri takes in a url of a video or a data uri of a video.", { videoUri: z.string() }, async ({ videoUri }) => { const task = await callRunwayAsync("/video_upscale", { method: "POST", body: JSON.stringify({ videoUri, model: "upscale_v1" }), }); return { content: [{ type: "text", text: JSON.stringify(task) }] }; } );
- src/index.ts:145-151 (handler)The handler function that executes the tool: sends POST to /video_upscale endpoint with videoUri and model, awaits task completion, returns JSON stringified task.async ({ videoUri }) => { const task = await callRunwayAsync("/video_upscale", { method: "POST", body: JSON.stringify({ videoUri, model: "upscale_v1" }), }); return { content: [{ type: "text", text: JSON.stringify(task) }] }; }
- src/index.ts:144-144 (schema)Input schema using Zod: requires 'videoUri' as a string (URL or data URI of the video).{ videoUri: z.string() },
- src/index.ts:59-72 (helper)Helper function used by the handler to call Runway API and automatically wait for asynchronous task completion by polling.async function callRunwayAsync( path: string, opts: Partial<RequestInit> = {} ): Promise<RunwayTask> { const response = (await callRunway(path, opts)) as { id?: string; } & RunwayTask; // If the response has a taskId, wait for completion if (response?.id) { return waitForTaskCompletion(response.id); } // If no taskId, just return the response as is return response; }