Skip to main content
Glama

TokenHub 图生图/图片编辑

tokenhub_edit_image

Generate or edit images from 1-16 reference images plus a text prompt, with optional mask-based local repainting; returns image URLs, request ID, and token usage.

Instructions

调用 TokenHub 接口,基于 1-16 张输入图 + 文本描述同步生成图片(模型默认 custom-model-og-v2,需开白)。支持局部重绘(mask)。输入图支持 URL 或 base64。返回图片 URL 列表、request_id 与 token 用量。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNo生成图片数量 1-10,默认 1
maskNo局部重绘蒙版图,尺寸需与输入图一致
sizeNo生成尺寸 "宽x高",如 2048x2048。约束:单边≤3840px、宽高为 16 的倍数、长短边比≤3:1、总像素 655360~8294400
modelNo单次覆盖模型名。不传时用环境变量 TOKENHUB_MODEL(默认 custom-model-og-v2)
imagesYes输入图 1-16 张,支持 URL 或 base64
promptYes文本描述,最大 32000 字符
qualityNo画质,默认 auto
base_urlNo单次覆盖站点域名(如 https://tokenhub.tencentmaas.com)。不传时用环境变量 TOKENHUB_BASE_URL
backgroundNo图像背景透明度:transparent 透明 / opaque 不透明 / auto 自动判断,默认 auto
output_formatNo输出格式,默认 png
response_formatNo返回格式:url(图片地址)或 b64_json(base64 数据),默认 url
output_compressionNoJPEG 压缩级别 0-100,仅 output_format=jpeg 时生效
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses the model default, whitelist requirement, mask support, URL/base64 input acceptance, and return fields. It does not mention error behavior, rate limits, or auth mechanics, but it covers the main operational characteristics well.

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?

The description is compact, informative, and well-front-loaded. It covers the core operation, constraints, input formats, mask feature, and return payload in four sentences with no fluff or 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 the 12-parameter schema and absence of an output schema, the description provides enough operational context: input requirements, image count range, model default and whitelist, mask support, and response contents. It falls short of 5 only because of missing explicit alternative-tool routing and access/auth context.

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 the baseline is 3. The description mentions mask, input images, model default, and input formats, but most of these details are already documented in the schema. It adds only high-level context like whitelist and return metadata, not substantial new parameter-level semantics.

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 clearly states the operation: calling TokenHub to generate an image from 1-16 input images plus a text prompt, with support for mask-based local repainting. It also specifies the output contents (image URL list, request_id, token usage), making the tool's purpose and scope unambiguous.

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 gives clear contextual signals for when to use this tool: when existing images are provided as input and editing/repainting is needed. It doesn't explicitly exclude or name the alternative tokenhub_generate_image, so the routing guidance is implied rather than explicit.

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/willsygao/tokenhub-aigc-model'

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