image-generate
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImage Generate
图片生成
Generates an image from a text prompt using AI image generation models.
借助AI图像生成模型,根据文本提示生成图片。
Command
命令
bash
agent-media image generate --prompt <text> [options]bash
agent-media image generate --prompt <text> [options]Inputs
输入参数
| Option | Required | Description |
|---|---|---|
| Yes | Text description of the image to generate |
| No | Width of the generated image in pixels (default: 1280) |
| No | Height of the generated image in pixels (default: 720) |
| No | Number of images to generate (default: 1) |
| No | Output path, filename or directory (default: ./) |
| No | Provider to use (default: auto-detect) |
| 选项 | 是否必填 | 描述 |
|---|---|---|
| 是 | 要生成的图片的文本描述 |
| 否 | 生成图片的宽度(单位:像素,默认值:1280) |
| 否 | 生成图片的高度(单位:像素,默认值:720) |
| 否 | 要生成的图片数量(默认值:1) |
| 否 | 输出路径、文件名或目录(默认值:./) |
| 否 | 使用的服务提供商(默认值:自动检测) |
Output
输出
Returns a JSON object with the generated image path:
json
{
"ok": true,
"media_type": "image",
"action": "generate",
"provider": "fal",
"output_path": "generated_123_abc.png",
"mime": "image/png",
"bytes": 567890
}返回包含生成图片路径的JSON对象:
json
{
"ok": true,
"media_type": "image",
"action": "generate",
"provider": "fal",
"output_path": "generated_123_abc.png",
"mime": "image/png",
"bytes": 567890
}Examples
示例
Generate an image:
bash
agent-media image generate --prompt "a red robot standing in a forest"Generate with specific dimensions:
bash
agent-media image generate --prompt "sunset over mountains" --width 1024 --height 768Generate using specific provider:
bash
agent-media image generate --prompt "abstract art" --provider replicate生成一张图片:
bash
agent-media image generate --prompt "a red robot standing in a forest"生成指定尺寸的图片:
bash
agent-media image generate --prompt "sunset over mountains" --width 1024 --height 768使用指定服务提供商生成:
bash
agent-media image generate --prompt "abstract art" --provider replicateProviders
服务提供商
This action requires an external provider:
- fal - Requires
FAL_API_KEY - replicate - Requires
REPLICATE_API_TOKEN - runpod - Requires
RUNPOD_API_KEY - ai-gateway - Requires
AI_GATEWAY_API_KEY
The local provider does not support image generation.
此操作需要使用外部服务提供商:
- fal - 需要配置
FAL_API_KEY - replicate - 需要配置
REPLICATE_API_TOKEN - runpod - 需要配置
RUNPOD_API_KEY - ai-gateway - 需要配置
AI_GATEWAY_API_KEY
本地服务提供商不支持图片生成。