image-edit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImage 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
输入参数
| Option | Required | Description |
|---|---|---|
| Yes | Input file path or URL |
| Yes | Text description of the desired edit |
| No | Output path, filename or directory (default: ./) |
| No | Provider to use (default: auto-detect) |
| No | Model override (e.g., |
| 选项 | 是否必填 | 描述 |
|---|---|---|
| 是 | 输入文件路径或URL |
| 是 | 所需编辑效果的文本描述 |
| 否 | 输出路径、文件名或目录(默认值:./) |
| 否 | 使用的服务商(默认值:自动检测) |
| 否 | 模型覆盖(例如: |
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 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 editing.
该操作需要外部服务商支持:
- fal - 需要
FAL_API_KEY - replicate - 需要
REPLICATE_API_TOKEN - runpod - 需要
RUNPOD_API_KEY - ai-gateway - 需要
AI_GATEWAY_API_KEY
本地服务商不支持图片编辑。