Skip to main content
Glama

改图 / 图生图

edit_image

Create new images from one or more local image files for style transfer, local edits, background replacement, outpainting, or multi-image fusion.

Instructions

基于一张或多张已有图片生成新图。用于风格迁移、局部修改、换背景、扩图、多图融合(把多张参考图合成一张新图)等。输入为本地文件路径。

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": {
      "prompt": "<prompt>",
      "image_paths": "<image_paths>"
    },
    "name": "edit_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
nNo生成张数,1-4,默认 1。数量越多越慢越贵
sizeNo尺寸,如 1024x1024 / 1024x1536 / 1536x1024 / auto。默认 1024x1024
modelNo模型 ID。模型名由中转站决定,可用 check_image_service 列出本站可用模型。当前别名(仅便捷,非通用标准):base=gpt-image-2, pro=gpt-image-2-pro, hq=gpt-image-2-pro, flare=gpt-image-2-5-flare, sunburst=gpt-image-2-5-sunburst。默认 gpt-image-2
promptYes图片描述(建议用英文或中英混合,细节越具体越好)
out_dirNo落盘目录。绝对路径或相对项目根目录;默认 ./output
qualityNo画质:low / medium / high / auto。默认 high
basenameNo文件名前缀(不含扩展名)。不传则按 prompt + 时间戳生成
mask_pathNo可选遮罩图路径(PNG,透明区域为要重绘的部分)
backgroundNo背景;transparent 出透明底 PNG
image_pathsYes输入图片的本地路径,可传多张做融合参考
output_formatNo期望的输出格式,默认 png

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are present, so the description carries the full burden. It discloses the local-filesystem input requirement and that multiple images can be fused, which is genuinely behavioral, but it says nothing about cost/latency scaling, that outputs are written to disk (implied only by schema params), or whether existing files are overwritten.

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?

Two sentences, front-loaded with the core action and followed by a compact list of applicable scenarios with no filler. Nothing repeats the schema or the title.

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

Completeness3/5

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

For an 11-parameter image generation tool with no annotations and no output schema, the description covers purpose and input source but omits where results land by default, latency/cost characteristics, and the role of mask-based local editing. The rich schema fills much of the gap, making the definition usable but not fully self-sufficient.

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 description coverage is 100%, so every one of the 11 parameters (n, size, model, quality, mask_path, output_format, etc.) is already documented inline. The description adds no parameter-level meaning beyond noting that input is a local path, so the baseline 3 applies.

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 gives a specific verb and resource: generate a new image based on one or more existing images, then enumerates concrete operations (style transfer, local edits, background replacement, outpainting, multi-image fusion). The phrase 'based on existing images' implicitly separates it from the text-only generate_image sibling, but that sibling is never named, so the contrast must be inferred.

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 clearly states the use cases (style transfer, local modification, changing background, outpainting, multi-image fusion) and the precondition that inputs are local file paths. It does not say when NOT to use it or point at check_image_service / generate_image as alternatives for model listing or from-scratch generation.

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

Deploy Server

Other Tools