mcpField
K
kaipai-image-remove-watermark

kaipai-image-remove-watermark

github.com/meituCreative & media277 installsUpdated 4w ago
Repository

About kaipai-image-remove-watermark

kaipai-image-remove-watermark is a skill that uses meitu-kaipai-cli to process images on a server, detecting and removing text and text watermarks while repairing covered backgrounds. It is for image-cleanup workflows and includes guidance for tracking task status and recovering results.

Key features

  1. 01Detect and remove image text and watermarks
  2. 02Repair backgrounds covered by text
  3. 03Submit image processing through the CLI
  4. 04Track task status and result links

Use cases

  1. 01Remove text watermarks from images
  2. 02Repair image backgrounds obscured by text
  3. 03Resume processing from an existing session

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/meitu/kaipai-skills --skill kaipai-image-remove-watermark

After installing, type/kaipai-image-remove-watermarkin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
platform.md
runtime.md
scripts/
ensure-cli.mjs

Details

From the project README

图片文字水印消除

能力与准备

使用 image-remove-text 智能识别并消除图片中的文字及文字水印,修复被覆盖的背景,提升画面整洁度与可用性。素材和文字清理目标明确时直接执行,由服务端完成识别与处理。

通过当前 CLI 支持的参数调用服务端处理能力,具体参数查询 help 或 contracts。依赖 meitu-kaipai-cli,已验证目标版本 0.1.11,兼容 >=0.1.11 <0.2.0。

首次执行先按平台接入运行CLI 准备脚本:缺失时默认全局安装,兼容时复用。目标、必要素材和授权齐全后沿用返回入口直接调用 CLI,不主动校验输入或运行独立预检;调用格式不明确时再按平台说明查询 help/contracts。遇到 CLI 输入错误、输出解析、服务端问询或执行异常时读取运行与恢复。

收集输入

  1. 从当前请求和附件取得一个真实图片文件或 URL;信息明确时不重复询问。多个候选且目标不明时询问,不自动代选;用户已明确授权逐个处理时分别调用并记录任务。
  2. 本地素材使用用户提供或上下文取得的真实路径;远程素材先按平台接入下载原资源,再作为本地文件上传。只有媒体 ID 时先查询所属会话的 Task 或历史取得真实 URL,再下载;失败时请用户自行下载并提供本地原文件。
  3. 继续已有任务时添加 -r '<session_id>';新任务省略会话。按平台说明应用默认值、准备登录和处理缺失输入;可选参数查询当前 help,未指定时省略。
  4. 保留原始来源、真实本地路径与会话作为恢复输入。用户补充下载好的文件后沿用原目标继续,不把失败结果当作源素材。

上传与提交

使用已解析的 CLI 入口,将准备好的本地文件作为独立参数传入:

kaipai tool image-remove-text --image-file '<本地图片路径>'

CLI 校验文件后,通过内置美图上传链路取得自有 CDN URL,再提交任务并默认等待本次执行结束。不先调用 create-room / add-media,不构造媒体占位文本。复杂输入按需使用参数文件;收到 CLI 输入错误后再针对性处理,安全传参与清理规则见平台说明。

跟进与交付

  • 保存原始输入、session_id / room_url 和全部真实 Task ID;分别持续读取原命令的 stdout 与 stderr,不同时另开轮询。
  • TASK_STATE_COMPLETED 且取得本次可用产物 URL 才交付处理结果。HTTP 200、流结束、退出码 0 或 end.reason=result 都不单独证明完成,未知任务状态不能视为成功。
  • 使用宿主可用的原生预览/附件或完整可点击 URL,保留查询参数,逐项交付所有可用 Part;部分成功先交付成功部分。有实际 room_url 时附开拍会话入口,不根据 ID 拼链接。
  • 断线、超时或受理未知时先查询原会话和任务,不自动重复提交。失败原因已修复且用户授权重试后才发起新尝试;输出产物下载失败只恢复下载。具体问询、恢复及本地保存步骤见运行说明。

Comments

Markdown supported