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
| Name | Required | Description | Default |
|---|---|---|---|
| generation_id | Yes | ||
| resolution | Yes |
Implementation Reference
- src/luma_ai_mcp_server/server.py:375-399 (handler)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
- src/luma_ai_mcp_server/server.py:523-527 (registration)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(), ),
- src/luma_ai_mcp_server/server.py:575-577 (registration)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"