image-edit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Image Edit

图片编辑

Edits an existing image using a text prompt (image-to-image transformation).
通过文本提示词编辑现有图片(图生图转换)。

Command

命令

bash
agent-media image edit --in <path> --prompt <text> [options]
bash
agent-media image edit --in <path> --prompt <text> [options]

Inputs

输入参数

OptionRequiredDescription
--in
YesInput file path or URL
--prompt
YesText description of the desired edit
--out
NoOutput path, filename or directory (default: ./)
--provider
NoProvider to use (default: auto-detect)
--model
NoModel override (e.g.,
fal-ai/flux-2/edit
)
选项是否必填描述
--in
输入文件路径或URL
--prompt
所需编辑效果的文本描述
--out
输出路径、文件名或目录(默认值:./)
--provider
使用的服务商(默认值:自动检测)
--model
模型覆盖(例如:
fal-ai/flux-2/edit

Output

输出

Returns a JSON object with the edited image path:
json
{
  "ok": true,
  "media_type": "image",
  "action": "edit",
  "provider": "fal",
  "output_path": "edited_123_abc.png",
  "mime": "image/png",
  "bytes": 567890
}
返回包含编辑后图片路径的JSON对象:
json
{
  "ok": true,
  "media_type": "image",
  "action": "edit",
  "provider": "fal",
  "output_path": "edited_123_abc.png",
  "mime": "image/png",
  "bytes": 567890
}

Examples

示例

Edit an image:
bash
agent-media image edit --in photo.jpg --prompt "make the sky more vibrant"
Add elements to an image:
bash
agent-media image edit --in portrait.png --prompt "add sunglasses"
Edit with specific provider:
bash
agent-media image edit --in scene.jpg --prompt "change to night time" --provider replicate
编辑图片:
bash
agent-media image edit --in photo.jpg --prompt "make the sky more vibrant"
为图片添加元素:
bash
agent-media image edit --in portrait.png --prompt "add sunglasses"
使用指定服务商编辑:
bash
agent-media image edit --in scene.jpg --prompt "change to night time" --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 editing.
该操作需要外部服务商支持:
  • fal - 需要
    FAL_API_KEY
  • replicate - 需要
    REPLICATE_API_TOKEN
  • runpod - 需要
    RUNPOD_API_KEY
  • ai-gateway - 需要
    AI_GATEWAY_API_KEY
本地服务商不支持图片编辑。