Skip to main content
Glama

upscale_generation

Increase video resolution to 540p, 720p, 1080p, or 4k using a generation ID for enhanced clarity and quality in Luma Dream Machine workflows.

Instructions

Upscales a video generation to higher resolution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
generation_idYes
resolutionYes

Implementation Reference

  • The main handler function that performs the upscale_generation tool logic by making a POST request to the Luma API upscale endpoint.
    async def upscale_generation(parameters: dict) -> str: """Upscale a video generation.""" try: generation_id = parameters.get("generation_id") if not generation_id: raise ValueError("generation_id parameter is required") resolution = parameters.get("resolution") if not resolution: raise ValueError("resolution parameter is required") request_data = {"generation_type": "upscale_video", "resolution": resolution} result = await _make_luma_request( "POST", f"/generations/{generation_id}/upscale", request_data ) return ( f"Upscale initiated for generation {generation_id}\n" f"Status: {result['state']}\n" f"Target resolution: {resolution}" ) except Exception as e: logger.error(f"Error in upscale_generation: {str(e)}", exc_info=True) return f"Error upscaling generation {generation_id}: {str(e)}"
  • Pydantic model defining the input schema for the upscale_generation tool, including generation_id and resolution.
    class UpscaleGenerationInput(BaseModel): generation_id: str resolution: Resolution
  • Registration of the upscale_generation tool in the MCP server's list_tools method, specifying name, description, and input schema.
    Tool( name=LumaTools.UPSCALE_GENERATION, description="Upscales a video generation to higher resolution", inputSchema=UpscaleGenerationInput.model_json_schema(), ),
  • The switch case in call_tool that dispatches to the upscale_generation handler.
    case LumaTools.UPSCALE_GENERATION: result = await upscale_generation(arguments) return [TextContent(type="text", text=result)]
  • Enum constant defining the tool name in LumaTools.
    UPSCALE_GENERATION = "upscale_generation"

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bobtista/luma-ai-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server