文生图
generate_imageGenerates images from text prompts via GPT Image API, saves them locally, and returns the absolute path and file URI. Use it when you need an image file from a description.
Instructions
根据提示词调用 GPT Image 生成一张图片,保存到本机并返回绝对路径和文件 URI。调用会产生 API 费用。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | 输出尺寸:auto 或 WIDTHxHEIGHT(如 1024x1024、1536x1024、3840x2160)。宽高需为 16 的倍数,比例不超过 3:1。 | auto |
| format | No | 保存的图片格式。 | png |
| prompt | Yes | 图片内容、风格、构图等要求。 | |
| quality | No | 生成质量,越高通常越慢且费用越高。 | auto |
| background | No | 背景模式;transparent 需配合 png 或 webp 格式。 | auto |
| moderation | No | 内容安全审核级别。 | auto |
| output_compression | No | 输出压缩率(0-100),仅 jpeg 和 webp 格式生效。 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | ||
| images | Yes |