image-generate

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Image 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

输入参数

OptionRequiredDescription
--prompt
YesText description of the image to generate
--width
NoWidth of the generated image in pixels (default: 1280)
--height
NoHeight of the generated image in pixels (default: 720)
--count
NoNumber of images to generate (default: 1)
--out
NoOutput path, filename or directory (default: ./)
--provider
NoProvider to use (default: auto-detect)
选项是否必填描述
--prompt
要生成的图片的文本描述
--width
生成图片的宽度(单位:像素,默认值:1280)
--height
生成图片的高度(单位:像素,默认值:720)
--count
要生成的图片数量(默认值:1)
--out
输出路径、文件名或目录(默认值:./)
--provider
使用的服务提供商(默认值:自动检测)

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 768
Generate 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 replicate

Providers

服务提供商

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
本地服务提供商不支持图片生成。