Skip to main content
Glama

Inpaint / outpaint an image with a mask

replicate_inpaint

Fill masked image regions from a text prompt to replace objects or extend the canvas. Use it for inpainting and outpainting by painting a mask over the target area.

Instructions

Fill masked regions of an image based on a text prompt. Works for both inpainting (replace inside) and outpainting (extend canvas) when the mask covers the target area.

DISPLAY REQUIREMENT — embed the result inline using one of the three blocks (iframe / / markdown) printed by the tool.

Args:

  • image (URL): Source image.

  • mask (URL): Mask image. White = keep, black/transparent = repaint.

  • prompt: Describes what should appear in the masked region.

  • model (default "flux-fill-pro"): Curated (flux-fill-pro, sd-inpaint, ideogram-v2-edit) or "owner/name".

  • extra_input (object, optional): Model-specific extras (e.g. {guidance: 30} for flux-fill-pro).

Input Schema

NameRequiredDescriptionDefault
maskYesURL of the mask. White areas are kept; black/transparent areas are inpainted.
imageYesURL of the source image.
modelNoInpaint model. Curated: flux-fill-pro, sd-inpaint, ideogram-v2-edit. Or "owner/name".flux-fill-pro
promptYesText describing what to paint in the masked area.
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 cover the safety profile (non-read-only, open-world, non-idempotent, non-destructive), so the lower bar applies. The description still adds important non-schema behavior: a hard DISPLAY REQUIREMENT to embed the result via iframe/<img>/markdown, and the curated-vs-owner/name model resolution rule. It omits anything about cost or async/polling semantics beyond the timeout parameter description.

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

Conciseness5/5

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

Front-loads purpose in one sentence, then flags the display requirement, then a compact Args list. Every line carries information; the mask polarity repetition is the only minor 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?

With no output schema, the description carries the return-value burden and does so by telling the agent to embed the tool-printed blocks. The display requirement and model default make it callable without guesswork. It does not cover what happens on failure or what the non-embedded/raw result contains.

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 71%, so the schema already documents most parameters. The description adds genuine meaning beyond it: mask polarity restated in operational terms (white = keep, black/transparent = repaint) and, most usefully, a concrete extra_input example (`{guidance: 30}` for flux-fill-pro) that the schema leaves as an untyped bag. `download` is undocumented in both.

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?

States a specific verb+resource ('Fill masked regions of an image based on a text prompt') and immediately disambiguates the two modes (inpainting vs outpainting). This clearly separates it from sibling generation tools like replicate_generate_image, which have no mask concept.

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?

Explains the mask condition that selects inpainting vs outpainting ('when the mask covers the target area'), giving real usage context. It does not, however, name explicit alternatives (e.g. use replicate_generate_image when no mask is needed), so the agent must infer the boundary.

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