Skip to main content
Glama

inpaint_image

Replace masked areas of an image with AI-generated content using Stable Diffusion. Provide an image, mask, and prompt to paint the selected region and wait for the completed result.

Instructions

Inpaint an image using Stable Diffusion. Waits for completion and returns the result.

Args:
    pipeline: Pipeline to use — "sd15", "sdxl", or "illustrious"
    positive_prompt: Text prompt describing what to paint in the masked region
    model_checkpoint: Model checkpoint filename to use
    image_base64: Base64-encoded input image
    mask_base64: Base64-encoded mask image (white = inpaint region)
    negative_prompt: Negative prompt (things to avoid)
    steps: Number of inference steps (1-150)
    cfg_scale: Classifier-free guidance scale (1-30)
    seed: Random seed (-1 for random)
    scheduler: Noise scheduler name
    loras: Optional list of LoRA configs, each with "name" (str) and optional "strength" (float 0-1)
    custom_vae: Optional custom VAE checkpoint filename

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seedNo
lorasNo
stepsNo
pipelineYes
cfg_scaleNo
schedulerNoDPM++ 2M
custom_vaeNo
mask_base64Yes
image_base64Yes
negative_promptNo
positive_promptYes
model_checkpointYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations exist, so the description carries the full behavioral burden. It does disclose the most important trait — synchronous blocking until completion — which is genuinely valuable. However, for a GPU-bound image operation it stays silent on timeouts, resource intensity, failure semantics, or payload size constraints, which an agent might reasonably need to choose this over alternatives.

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 behavioral summary is front-loaded in one crisp sentence, followed by a conventional param-per-line docstring. Each line earns its place with additional detail. Minor deduction: entries like 'model_checkpoint', 'scheduler', and 'custom_vae' mostly restate their names, and the docstring could be trimmed slightly, but nothing is redundant enough to hurt.

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?

Across description and schema, an agent has everything needed to call this correctly: valid pipeline strings, the masking convention, LoRA structure, and defaults. The existence of an output schema covers return-value details. Gaps like expected base64 format (raw vs data URI) and image dimension limits exist, but for moderate-complexity tooling, the documentation is strong.

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?

With 0% schema description coverage, the description must compensate fully — and it does. It captures the white=mask convention for mask_base64, enumerates valid pipeline values (sd15/sdxl/illustrious), gives ranges (1-150, 1-30), documents the -1 random seed sentinel, and explains the LoRA config structure. Nearly every parameter gains meaning beyond its name.

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

Purpose4/5

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

The description pairs a specific verb+resource+method ('Inpaint an image using Stable Diffusion') with a key differentiator ('Waits for completion and returns the result') that separates it from the async submit_* siblings. It doesn't name the sibling explicitly like the gold standard, but the synchronous/blocking qualifier makes the distinction clear.

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

Usage Guidelines3/5

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

'Waits for completion and returns the result' is a genuine usage signal that implies contrast with submit_inpaint and cancel_job, telling the agent this is the synchronous inpainting path. However, it's implied rather than stated — there's no explicit 'use this for X, use submit_inpaint for Y' guidance despite the pair being the most obvious alternative.

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

Install Server

Other 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/mcaimi/sd-api-mcp'

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