Skip to content

meitu/kaipai-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kaipai AI (OpenClaw skill)

Process images and video with Kaipai AI: watermark removal and quality restoration. Works inside OpenClaw with a single CLI entrypoint: scripts/kaipai_ai.py.

Capabilities

Calls go to the Kaipai commercial API and consume account quota (credits) for the configured MT_AK tenant. Agents must not tell users the service is free or guess pricing — see SKILL.md (Billing and user-facing claims).

task_name What it does
eraser_watermark Image watermark removal
videoscreenclear Video watermark removal
image_restoration Image quality restoration
hdvideoallinone Video quality restoration

Install

Install the skill folder as your OpenClaw skill (path or marketplace URL your host documents), then restart the gateway if required.

One-time setup

  1. Put MT_AK and MT_SK in scripts/.env (or export them in the environment).
  2. Run:
python3 scripts/kaipai_ai.py preflight

Output must be ok.

Dependencies

python3 scripts/kaipai_ai.py install-deps

Uses scripts/requirements.txt (e.g. requests, OSS client as needed).

URL inputs (--input https://...)

  • Shell: Quote the full URL so & in query strings is not broken (e.g. signed storage URLs).
  • Limits: Streamed download with 15s connect / 120s read timeouts and 100MB max by default (shared with resolve-input --url). Override: MT_AI_URL_CONNECT_TIMEOUT, MT_AI_URL_READ_TIMEOUT, MT_AI_URL_MAX_BYTES.
  • Large or slow media: Use resolve-input --url … to save locally, then pass the returned path as --input.

Quick examples

Image watermark removal (blocking):

python3 scripts/kaipai_ai.py run-task \
  --task eraser_watermark \
  --input "https://example.com/photo.jpg"

Video task (async worker payload):

python3 scripts/kaipai_ai.py spawn-run-task \
  --task hdvideoallinone \
  --input "https://example.com/clip.mp4" \
  --deliver-to "oc_xxx_or_ou_xxx" \
  --deliver-channel feishu

Pass the printed sessions_spawn_args to OpenClaw sessions_spawn. Keep runTimeoutSeconds at the payload default (3600); do not reduce it without accepting timeout risk. Wall time varies. If a host session/tool wait cap cuts off before JSON finishes, recover with last-task / history / query-task (see SKILL.md and docs/errors-and-polling.md).

Two-stage video (e.g. videoscreenclear then hdvideoallinone): run spawn-run-task + sessions_spawn twice — one embed per stage, like medeo-video’s one-command-per-spawn. After the first worker finishes, take primary_result_url from its JSON (or last-task) and pass it as --input on the second spawn-run-task. No extra CLI flags.

Resume polling by task id:

python3 scripts/kaipai_ai.py query-task --task-id "<full_task_id>"

Last run / history (local state under ~/.openclaw/workspace/openclaw-kaipai-ai/):

python3 scripts/kaipai_ai.py last-task
python3 scripts/kaipai_ai.py history

IM attachment → local path for --input:

python3 scripts/kaipai_ai.py resolve-input --telegram-file-id "AgAC..." --output-dir /tmp

See docs/im-attachments.md and SKILL.md for agents.

Operators

One line: Video tasks → spawn-run-task (not a blocking run-task in the main session); if a job was cut off or the user asks for status → last-task / query-task — never submit run-task again for the same task_id.

New jobs: Agents must submit only via kaipai_ai.py run-task (or the same command inside spawn-run-task); do not call AIGC/wapi directly and skip /skill/consume.json — see SKILL.md section API submission path (MANDATORY).

Docs

License

MIT (see repository root if present).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages