Skip to main content
Glama

upscale_image

Upscale PNG or JPEG images 2x or 4x with super-resolution models that add plausible detail; preserve PNG transparency and process large images in tiles.

Instructions

Upscale an image (PNG or JPEG) 2x or 4x with a super resolution model, adding plausible detail.

model: "realesrgan-x4plus" (default; general purpose, suits concept art, renders and photos, and cleans up mild noise and JPEG artefacts) or "pbrify-v4" (made for game textures such as albedo, roughness or normal maps; keeps fine surface detail; about 3 times slower). scale: 4 (the models' native scale) or 2 (the 4x result downscaled by half with Lanczos). keep_alpha: a PNG with transparency keeps it; the alpha channel is upscaled smoothly, the colour by the model. keep_alpha=False writes an opaque RGB PNG. Large images are processed in tiles inside the backend, so any size fits in VRAM; the result is limited to 8192 px per side (for example 2048 px at 4x, 4096 px at 2x) and is an 8-bit PNG. Measured on this GPU: about 0.5 s per megapixel of 4x output with the default model and 1.5 s with pbrify-v4 (a 1024 px image takes about 9 s and 25 s), plus any wait for the shared queue. Output: <output_dir or /ai/output/localgen/upscale/>/_x.png. Returns the path, input and output sizes, whether alpha was kept, and timings.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "input_image": "<input_image>"
    },
    "name": "upscale_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelNo
scaleNo
keep_alphaNo
output_dirNo
input_imageYes
idle_timeout_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full behavioral burden and does so thoroughly: tiled processing so any size fits VRAM, a hard 8192 px per-side cap with worked examples, 8-bit PNG output, alpha channel handling, and shared-queue waiting. It even quantifies runtime (~0.5 s/MP default, 1.5 s/MP pbrify-v4, with a 1024 px worked example).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The lead sentence states the core action before the labelled per-parameter lines, so it is well front-loaded and every line carries usable detail. The timing paragraph is slightly dense but justifies itself by letting the agent reason about job duration; overall length is on the edge of verbose for a six-parameter tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, yet the description specifies the return payload (path, input/output sizes, alpha retention, timings) and the exact path template, which is what an agent needs. The only real hole is the undocumented idle_timeout_seconds parameter and the absence of any note on failure modes for unsupported inputs.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does for model, scale, keep_alpha (including exactly what happens to the alpha vs. colour channels), output_dir (via the output path template) and input_image. The sixth parameter, idle_timeout_seconds, is never mentioned anywhere, leaving one unexplained knob.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence names a specific verb and resource (upscale an image), the accepted formats (PNG/JPEG), the factors (2x/4x) and the mechanism (super resolution model). It is unmistakably distinct from the generate_* siblings, which create new content rather than enlarging an existing file.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete selection criteria between the two models (general purpose vs. game textures like albedo/roughness/normal maps) and between the two scales (native 4x vs. Lanczos-downscaled 2x). What is missing is an explicit statement of when not to use this tool, e.g. pointing at generate_image or remove_background as alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.