Skip to main content
Glama

generate_image

Generate images from text prompts, with configurable resolution, model, style, and seed. Produce multiple variations and receive URLs or base64 data for easy download.

Instructions

文生图:根据文本提示词生成图片(参数语义对齐 OpenAI Images API)。

Args: prompt: 描述期望图像内容、风格与构图的提示词(中英文均可)。 model: 模型名。默认 z-image-turbo;可选 qwen-image-3.0 / qwen-image-3.0-pro, 或任意 OpenAI 兼容后端模型(如 qwen-image-3)。 size: 输出分辨率,OpenAI 风格 "宽x高"(如 "1024x1024"),DashScope 下自动转换为 "宽*高"。 n: 生成张数(z-image 每张单独调用,qwen-image-3.0 单次最多 6 张)。 quality: 质量档位(OpenAI 语义;DashScope 原生接口忽略)。 style: 风格(OpenAI 语义;DashScope 原生接口忽略)。 response_format: "url" 返回远端 URL + 本地路径;"b64_json" 额外返回 base64 数据。 seed: 随机种子 [0, 2147483647],用于结果复现。 negative_prompt: 反向提示词(qwen-image-3.0 支持;z-image 不支持)。 prompt_extend: 是否开启提示词智能改写(z-image/qwen 均支持,默认跟随模型侧默认值)。 watermark: 是否添加水印(仅 qwen-image-3.0 支持)。 output_dir: 本地保存目录(相对路径相对于全局输出目录)。 user: 透传给 OpenAI 兼容后端的 user 字段(可选)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNo
seedNo
sizeNo1024x1024
userNo
modelNo
styleNonatural
promptYes
qualityNostandard
watermarkNo
output_dirNo
prompt_extendNo
negative_promptNo
response_formatNourl

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description takes on full responsibility and excels. It discloses model-specific behaviors (e.g., 'z-image 每张单独调用,qwen-image-3.0 单次最多 6 张'), parameter side effects ('quality 在 DashScope 原生接口忽略'), and output details ('url 返回远端 URL + 本地路径;b64_json 额外返回 base64 数据'), providing rich operational context.

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 front-loaded with a one-sentence summary, followed by a structured bullet list of parameter explanations. Despite its length, each entry provides necessary semantic detail for a 13-parameter tool, with no filler or redundant phrasing.

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

Completeness5/5

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

Given the tool's complexity (13 parameters, no annotations, no schema descriptions), the description is exceptionally complete. It covers all parameter behaviors, model differences, output formats, and local file saving, making it sufficient for an agent to select and invoke the tool correctly without additional context.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate, and it does thoroughly. Every parameter is explained with meaningful details: size format conversion ('宽x高' to '宽*高'), model options and defaults, support matrix for negative_prompt and watermark, and seed range [0, 2147483647]. This greatly exceeds the bare 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 opens with '文生图:根据文本提示词生成图片' (text-to-image: generate an image from a text prompt), which clearly states the tool's verb (generate) and resource (image). This distinguishes it from sibling tools like edit_image and generate_video, making the purpose unmistakable.

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?

Usage is implied by the '文生图' (text-to-image) label, but there is no explicit guidance on when to choose this tool over alternatives like edit_image or generate_video. The description mentions '参数语义对齐 OpenAI Images API' but does not state exclusions or alternative tool references, so the agent must infer the appropriate context.

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/smjda0719/dsh-image-generate'

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