Skip to main content
Glama

restore_face

Restore blurry, damaged, or AI-generated faces to natural sharpness with adjustable fidelity. Enhances background and upscales images using CodeFormer.

Instructions

Restore blurry, damaged, or AI-generated faces to sharp, natural quality. Uses CodeFormer (NeurIPS 2022, state-of-the-art FID 32.65 on CelebA-Test). Adjustable fidelity — balance between quality enhancement and identity preservation. Also enhances background and upsamples. Stable endpoint — model upgrades automatically as SOTA evolves. 5 sats per image, pay per request with Bitcoin Lightning — no API key or signup needed. Requires create_payment with toolName='restore_face'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paymentIdYesValid payment ID (must be paid)
imageBase64YesBase64-encoded image containing faces (PNG, JPEG, WEBP) or data URI
fidelityNoFidelity to input: 0.0 = max quality enhancement, 1.0 = max identity preservation (default 0.5)
background_enhanceNoAlso enhance the background (default true)
face_upsampleNoUpsample restored faces (default true)
upscaleNoOutput upscale factor 1-4 (default 2)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior5/5

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

Without annotations, the description carries full burden. It discloses the underlying model (CodeFormer), adjustable fidelity, background enhancement, upsampling, stability, automatic upgrades, pricing, and payment process. This is comprehensive.

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 description is eight sentences, all adding value. It front-loads the main purpose and efficiently covers multiple aspects without redundancy.

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?

Given no output schema and no annotations, the description covers purpose, usage, pricing, and payment. It lacks details on return format or limitations (e.g., max image size) but is sufficient for a paid tool.

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

Parameters3/5

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

Schema coverage is 100%, so baseline is 3. The description mentions fidelity and enhancements but does not add new parameter meaning beyond the schema.

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 description specifies 'restore blurry, damaged, or AI-generated faces to sharp, natural quality,' using a clear verb and resource. It distinguishes from siblings like deblur_image and upscale_image by focusing on faces.

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 description explains the payment requirement and fidelity adjustment. It implies use for face restoration but does not explicitly state when to avoid it or compare with alternatives. Sibling context is provided but not leveraged.

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