meitu-cutout
Skill33 starsChanged 5 months agoMITView on GitHub
使用 meitu-cli 为人物、宠物、商品、图标或印章抠图,分离前景主体并生成透明背景 PNG。当用户针对上述五类主体提到抠图、去背景、透明背景、背景移除、cutout、remove background、提取主体时触发;白底隔离和其他主体类型不支持。
- Reads credentials
- Installs packages
In this repository55 other files it gives its agents.
- meitu-toolsSkill
- SKILL.mdSkill
- audio-music-generateSkill
- audio-song-generateSkill
- image-background-replaceSkill
- image-cutoutSkill
- image-denoise-enhanceSkill
- image-editSkill
- image-element-removeSkill
- image-face-swapSkill
- image-grid-splitSkill
- image-id-photo-generateSkill
- image-lowlight-enhanceSkill
- image-outfit-swapSkill
- image-portrait-generateSkill
- image-poster-generateSkill
- image-searchSkill
- image-style-transferSkill
- image-superres-enhanceSkill
- image-text-replaceSkill
- image-to-videoSkill
- image-transformSkill
- meitu-beautySkill
- meitu-carouselSkill
- meitu-game-2d-assetsSkill
- meitu-id-photoSkill
- meitu-image-adaptSkill
- meitu-image-fixSkill
- meitu-posterSkill
- meitu-product-swapSkill
- meitu-product-viewSkill
- meitu-stickersSkill
- meitu-upscaleSkill
- meitu-video-danceSkill
- meitu-visual-meSkill
- text-code-editSkill
- text-codeSkill
- text-generateSkill
- text-to-imageSkill
- text-to-videoSkill
- video-audio-addSkill
- video-canvas-expandSkill
- video-content-replaceSkill
- video-denoise-enhanceSkill
- video-effect-applySkill
- video-element-removeSkill
- video-framerate-enhanceSkill
- video-logo-addSkill
- video-lowlight-enhanceSkill
- video-motion-transferSkill
- video-multimodal-generateSkill
- video-quality-enhanceSkill
- video-resolution-upscaleSkill
- video-stitchSkill
- video-to-gifSkill
The file
Files
Meitu Cutout
Overview
调用 meitu image-cutout 从图片中分离前景主体,输出透明背景 PNG。仅支持人物、宠物、商品、图标、印章五类主体;可选人像、商品、图形三种模型,也可省略模型参数自动检测。
Dependencies
- meitu-cli:
npm install -g meitu-cli@latest - 凭证: 首选 env vars
MEITU_OPENAPI_ACCESS_KEY/MEITU_OPENAPI_SECRET_KEY,或预置~/.meitu/credentials.json;仅在用户明确要求写入本地凭证时,再执行meitu config set-ak --value "..."/meitu config set-sk --value "..."
路径别名: 下文中
$VISUAL={OPENCLAW_HOME}/workspace/visual/
Core Workflow
Preflight → [Context: 跳过(工具型抠图,无创意自由度)] → Execute → DeliverPreflight
meitu --version→ 未安装则提示npm install -g meitu-cli@latestmeitu auth verify --json→ 凭证无效则引导配置- Detect mode: cwd has
openclaw.yaml→ project mode; else → one-off 检查$VISUAL目录 → 确定 capabilities - output_dir 解析(Preflight 内 MUST 完成):
Resolve output_dir: openclaw.yaml →
./output/| else →$VISUAL/output/meitu-cutout/mkdir -p {output_dir}
Execute
输入解析
用户提供图片,支持两种形式:
- 本地文件路径(如
./photo.jpg) - 图片 URL(如
https://example.com/photo.jpg)
如果用户只说"帮我抠图"但没给图片 → 问:"请提供需要抠图的图片(本地路径或 URL)"。
模型选择
| 图片主体 | model_type | 输出 |
| 人像、证件照、半身照 | 0 | 透明底 PNG,保留发丝细节 |
| 商品、产品、电商图 | 1 | 透明底 PNG,优化产品边缘 |
| 设计素材、图标、印章 | 2 | 透明底 PNG |
| 宠物或类型不确定 | 省略 | 服务端自动选择模型,输出透明底 PNG |
model_type 仅允许 0、1、2。建筑、植物、车辆、食物、家具等非五类主体以及白底隔离不受支持,不得通过 prompt 或替代 API 绕过限制;需要生成白底时改用 image-edit。
工具调用
单张抠图:
meitu image-cutout --image_url {image_url_or_path} --json --download-dir {output_dir} --skill_name skill_meitu-cutout明确指定模型时追加 --model_type 0、--model_type 1 或 --model_type 2;省略时自动选型。
批量处理
批量处理整个目录:
meitu batch image-cutout --input-dir {input_dir} --output-dir {output_dir} --skill_name skill_meitu-cutout整个批次共用固定模型时追加 --model-type 0、--model-type 1 或 --model-type 2。逐条指定时使用 JSON/YAML 配置,条目字段 modelType(兼容 model_type)映射到单次命令的 model_type。批处理默认并发数为 3,输出 .png。
注意:单次命令不支持 --image_list;输入参数只接 --image_url(别名 --image)。
结果检查
解析 --json 输出:
ok: true→ 成功,downloaded_files[0].saved_path为本地已下载的结果 PNG(透明背景);若未使用--download-dir,则取media_urls[0]ok: false→ 检查code和hint
错误降级
| 级别 | 动作 | 说明 |
| L1 | 调整模型选择 | 自动检测不准时,根据主体改用 --model_type 0、1 或 2 |
| L2 | 检查图片格式/大小 | 确保图片可访问且非损坏 |
| L3 | 停止并报错 | 2 次连续失败后,输出 code + hint |
非五类主体或白底隔离直接返回不支持,不调用、不重试。
特殊错误:
ORDER_REQUIRED→ 提示用户充值,展示action_urlCREDENTIALS_MISSING→ 提示配置 AK/SK
Deliver
直接使用 Preflight 解析的 output_dir。
mv {file} {output_dir}/{date}_{name}_cutout.png
Output
- 格式: PNG(透明背景)
- 命名:
{YYYY-MM-DD}_{descriptive-name}_cutout.png- 例:
2026-03-23_product-photo_cutout.png
- 例:
- 位置: 由 Deliver 步骤决定(项目 →
./output/,一次性 →$VISUAL/output/meitu-cutout/)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

