Skip to main content
Glama

Upscale / restore an image with Replicate

replicate_upscale_image

Upscale low-resolution images to higher resolution and optionally restore faces in photos using selectable models, then download the processed result.

Instructions

Upscale an image to higher resolution. Optional face restoration for photos.

DISPLAY REQUIREMENT — after this tool returns successfully, embed the upscaled image inline using one of the three blocks (iframe / / markdown) printed by the tool. Place it BEFORE descriptive prose. URLs expire ~24h.

Args:

  • image (string URL): URL of the source image.

  • model (string, default "real-esrgan"): Curated key (real-esrgan, clarity-upscaler, swinir, gfpgan) or "owner/name".

  • scale (1-10, optional): Upscale factor. Default 4 for real-esrgan; 2 for gfpgan; 2 for clarity-upscaler.

  • extra_input (object, optional): Model-specific extras (e.g. {face_enhance: true} for real-esrgan).

  • download (boolean, default true): Download upscaled file locally.

Returns: PredictionResult with urls + local_paths to the upscaled image.

Examples:

  • image="", scale=4 → real-esrgan

  • image="", model="gfpgan", scale=2 → restoration

  • image="", model="clarity-upscaler", scale=2

Input Schema

NameRequiredDescriptionDefault
imageYesURL of the image to upscale.
modelNoUpscaler. Curated: real-esrgan, clarity-upscaler, swinir, gfpgan, clarity-pro. Or "owner/name".real-esrgan
scaleNoUpscale factor (1–10). Model-dependent; default 4 for real-esrgan.
downloadNo
timeout_msNoMax ms to wait for the prediction. If exceeded, returns the prediction ID so you can poll via replicate_get_prediction. Default: 300000 (5min).
extra_inputNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.3.1
    • addedInput schema / properties / extra_input / propertyNames
      Added value: +{
      +  "type": "string"
      +}
  2. First observedv3.2.3

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare it is a non-read-only, open-world, non-idempotent, non-destructive operation, so the description is free to add value elsewhere — and it does: the display/embedding requirement for the returned image, the ~24h URL expiry, the default local download, and the timeout fallback to a prediction ID for polling. These are real operational traits not derivable from annotations.

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?

Purpose and the display requirement are front-loaded, then args, returns and examples follow in a scannable structure. The args section partially restates schema fields (image, model), costing some redundancy, but the examples and display rule each earn their place.

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

Completeness5/5

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

For a 6-parameter tool with a nested object and no output schema, the description covers what the agent needs: source image, model selection strategy, scale semantics, extras, download behavior, timeout fallback, and the shape of the return value (urls + local_paths). Nothing required to call it correctly is missing.

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 coverage is 67%, and the description compensates for the gaps: it gives per-model default scale values (4 for real-esrgan, 2 for gfpgan, 2 for clarity-upscaler) beyond the schema's single real-esrgan note, and it explains extra_input with a concrete model-specific example ({face_enhance: true}) that the schema leaves entirely undescribed. Minor inconsistency: the curated list omits 'clarity-pro' which the schema enum includes.

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?

Opens with a specific verb+resource ('Upscale an image to higher resolution') and adds the differentiating capability ('optional face restoration for photos'), which cleanly separates it from siblings like replicate_inpaint, replicate_remove_background and replicate_generate_image. An agent can identify the tool from the first sentence alone.

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?

The three worked examples give concrete use cases that map model choice to intent (low-res photo → real-esrgan, face photo → gfpgan, artwork → clarity-upscaler), which is actionable routing guidance. It stops short of stating exclusions (e.g. when to choose replicate_inpaint or replicate_run_model instead), so it does not reach a 5.

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