← 返回 Skills 市场
flyelepai

product-replace

作者 flyelep · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ✓ 安全检测通过
186
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install flyelep-product-replace
功能描述
通过 Flyelep AI 工具接口将图片中的商品替换为指定商品图,同时保留原图背景及光影效果。 当用户要求替换商品主体、保留原场景换产品、保持背景不变更换展示商品时使用此技能。
使用说明 (SKILL.md)

Flyelep 商品替换

通过 Flyelep AI Tool API 将图片中的商品替换为目标商品,并返回替换后的新图片 URL。

重要:这是一个 HTTP API 调用技能。必须通过 HTTP POST 请求调用 API 接口,禁止通过浏览器访问 Flyelep 网站。

API 接口信息

  • URL: POST https://www.flyelep.cn/prod-api/poster-design/api/v1/poster/aiTool/productReplace
  • Content-Type: application/json
  • 认证方式: 在请求头中传入 secretKey
  • 超时时间: 建议 120-300 秒

认证方式

所有 AI 工具接口均需在请求头中传入 secretKey。该密钥需由用户在 Flyelep 开放平台申请获得:https://www.flyelep.cn/controlboard 。

请求头示例:

Content-Type: application/json
secretKey: 用户提供的API密钥

安全说明secretKey 必须放在请求头中,这是 AI 工具接口的统一鉴权要求。不要将真实密钥写入技能文件、示例代码仓库或持久化配置中,应在运行时由用户动态提供。

请求 Body

{
  "sourceUrl": "https://example.com/scene_with_old_product.jpg",
  "replaceImageUrl": "https://example.com/new_product.jpg",
  "modelType": 0,
  "textPrompt": "保留背景和光影,将主体商品替换为新的白色保温杯"
}

响应格式

统一响应结构:

{
  "code": 200,
  "msg": "操作成功",
  "data": "https://example.com/product_replaced.jpg"
}
  • code=200 表示调用成功
  • msg 为接口返回说明
  • data 为商品替换后的图片 URL

返回结果应直接展示给用户,不要回读图片内容。

参数说明

必传参数

字段 默认值 说明
sourceUrl - 原图链接,包含原始商品的图片
modelType - 模型类型:0=gemini-2.51=gemini-3-pro

可选参数

字段 默认值 说明
replaceImageUrl - 目标商品图链接,多张时用英文逗号分隔
textPrompt - 用户提示词

参数映射规则

sourceUrl

  • 传入待替换商品的原图公网 URL
  • 必须是图片直链,不要传网页地址
  • 原图中应清楚包含待替换商品和原背景环境

modelType

  • 0gemini-2.5
  • 1gemini-3-pro

推荐默认规则:

  • 用户未指定模型时,默认传 0
  • 若用户追求更好的效果,可先传 1

replaceImageUrl

  • 用于提供目标商品图
  • 暂时只支持单图
  • 当用户明确说“把原商品换成另一件商品”时,优先传入该字段

textPrompt

  • 用于补充替换要求,例如材质、颜色、角度、尺寸观感、保留方式
  • 可用于强调“保留原场景、保留光影、保留构图”
  • 当用户有明确风格要求时建议一并传入

推荐写法示例:

  • 保留背景和桌面反光,将商品替换为黑色蓝牙耳机
  • 保持原场景与阴影效果,将主体换成白色保温杯
  • 保留背景展台不变,将中间产品替换为新的香水瓶,风格保持高级简洁

说明:场景替换、商品替换、商品换色三个接口共用同一 DTO,由接口内部自动设置 type 字段,调用方无需传入 type

调用示例

结合目标商品图与文本约束替换商品:

curl -X POST "https://www.flyelep.cn/prod-api/poster-design/api/v1/poster/aiTool/productReplace" \
  -H "Content-Type: application/json" \
  -H "secretKey: 你的密钥" \
  --max-time 300 \
  -d '{
    "sourceUrl": "https://example.com/scene_with_old_product.jpg",
    "replaceImageUrl": "https://example.com/new_product_front.jpg,https://example.com/new_product_side.jpg",
    "modelType": 1,
    "textPrompt": "将商品替换为我上传的图片,颜色为红色"
  }'

常见错误及解决方案

错误 原因与解决
HTTP 401 / code 非 200 secretKey 无效、缺失或已过期,确认请求头是否正确传入
HTTP 405 Not Allowed 请求方法错误,必须使用 POST
sourceUrl 无法访问 原图 URL 不是公网直链、已过期,或源站限制访问
replaceImageUrl 无法访问 目标商品图 URL 无效、不可公开访问,或链接格式不正确
modelType 非 0/1 模型类型只支持 01
替换结果不像目标商品 目标商品图不够清晰或角度不足,可增加更多参考图并补充 textPrompt
商品替换后背景不协调 提示词未强调保留原背景和光影,可在 textPrompt 中补充说明
请求超时 原图较大、参考商品图较多或生成复杂时,可适当增大超时时间

提示词处理

该接口支持 textPrompt,但在商品替换场景下,目标商品图通常比纯文字更关键。

执行时应遵循:

  1. 优先保证 sourceUrl 清晰展示原场景和原商品
  2. 优先提供 replaceImageUrl,帮助模型准确识别目标商品
  3. 通过 textPrompt 强调保留项:背景、光影、角度、构图、摆放位置
  4. 通过 textPrompt 补充目标商品要求:颜色、材质、风格、展示方式

当用户真正想改的是“背景场景”而不是“商品主体”时,应改用场景替换 skill;当用户只是想换颜色而不是换商品,应改用商品换色类 skill。

安全使用建议
This skill appears coherent for calling Flyelep's product-replacement API, but before installing: 1) Only provide a Flyelep secretKey you obtained from their platform and avoid pasting it into skill files or public places; use the runtime credential entry the agent UI provides. 2) Confirm you trust Flyelep with the images you send (privacy, retention, and legal rights to edit/host those images). 3) Verify the HTTPS endpoint and your account's scopes/quotas to avoid unexpected charges. 4) If you allow the agent to invoke skills autonomously, be aware it could send image URLs you provide to the external API when triggered — restrict or monitor that behavior if images are sensitive.
能力评估
Purpose & Capability
Name and description match the SKILL.md: it describes calling Flyelep's productReplace API to swap product foreground while preserving background. The skill does not request unrelated credentials, binaries, or config paths.
Instruction Scope
SKILL.md limits actions to forming an HTTP POST to the specified Flyelep endpoint with a user-supplied secretKey in the header and a JSON body containing image URLs and prompts. It does not instruct reading local files, scanning system state, or exfiltrating unrelated data. The admonition to not access via browser is unusual but not harmful.
Install Mechanism
No install spec and no code files — instruction-only skill. Nothing is written to disk and no external packages are pulled.
Credentials
The skill requires a Flyelep API secret (provided at runtime via header) which is appropriate for this API-based task. It does not request unrelated environment variables or secrets. Note: secretKey is sensitive — the skill correctly warns not to bake it into the skill file.
Persistence & Privilege
always is false and the skill has no install or config changes. It does not request persistent system privileges or alteration of other skills' settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install flyelep-product-replace
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /flyelep-product-replace 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.2
- No file changes were detected in this version. - No user-facing updates or modifications were made.
v1.0.1
- 修正认证方式说明,明确了 secretKey 申请入口(增加了 https://www.flyelep.cn/controlboard 链接) - 其余技能使用说明和参数要求保持不变
v1.0.0
Flye 商品替换技能首次发布: - 支持通过 API 替换图片内商品为指定商品图,保留原有背景和光影效果 - 需传入原图 sourceUrl,目标商品 replaceImageUrl,支持自定义 textPrompt - 提供模型选择(gemini-2.5 或 gemini-3-pro) - 需通过 HTTP POST 并在请求头添加 secretKey 认证 - 详细说明参数用法、调用示例、接口响应和常见错误
元数据
Slug flyelep-product-replace
版本 1.0.2
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

product-replace 是什么?

通过 Flyelep AI 工具接口将图片中的商品替换为指定商品图,同时保留原图背景及光影效果。 当用户要求替换商品主体、保留原场景换产品、保持背景不变更换展示商品时使用此技能。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 186 次。

如何安装 product-replace?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install flyelep-product-replace」即可一键安装,无需额外配置。

product-replace 是免费的吗?

是的,product-replace 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

product-replace 支持哪些平台?

product-replace 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 product-replace?

由 flyelep(@flyelepai)开发并维护,当前版本 v1.0.2。

💬 留言讨论