mcpField
I
image-outfit-swap

image-outfit-swap

github.com/meituCreative & media36117 installsUpdated 9w ago
Repository

About image-outfit-swap

A skill for changing clothing in photos while preserving the person’s face, body shape, and overall appearance. It supports text-described outfits and clothing reference images, including simple color changes.

Key features

  1. 01Change outfits from text descriptions
  2. 02Use clothing reference images
  3. 03Preserve face and body shape
  4. 04Make simple clothing color changes
  5. 05Fall back across processing paths

Use cases

  1. 01Preview outfits on a person’s photo
  2. 02Create a try-on image from a clothing reference
  3. 03Change clothing to a specified color

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/meitu/meitu-skills --skill image-outfit-swap

After installing, type/image-outfit-swapin Claude Code to confirm it loaded.

Details

From the project README

Image Outfit Swap

Overview

对已有人物图片做 AI 换装,保留人物面部 / 体型 / 形象只替换衣物,支持文字描述目标服装或上传服装参考图(人物图+服装图通过 image_list 传入)。简单颜色修改(如"把裙子改成红色")也属于本工具。

执行前应让用户清楚知道:本 Skill 会读取 Meitu 凭证、调用本地 meitu CLI、将用户提供的人物图片、可选服装参考图与换装描述发送到 Meitu OpenAPI 处理,并把结果写入 ./output/ 或 $VISUAL/output/image-outfit-swap/。涉及人像照片时,应确认对照片中人物具备处理授权。

API Mapping

  • 换装主路径、轻量降级和兜底路径由 image-outfit-swap 路由内部处理。

Dependencies

  • meitu-cli: >=2.0.6
  • 凭证:CONFIG AKSK → meitu tools update;EXEC AKSK → 实际执行(见根 CONFIG.md)
  • 环境变量:MEITU_OPENAPI_TOOL_TASK_MODE=command

路径别名:$VISUAL = {OPENCLAW_HOME}/workspace/visual/

Core Workflow

Preflight → Execute → Deliver
Preflight
  1. meitu --version ≥ 2.0.6
  2. 已用 CONFIG AKSK 跑过 meitu tools update
  3. 当前 AKSK = EXEC,MEITU_OPENAPI_TOOL_TASK_MODE=command
  4. output_dir:openclaw.yaml → ./output/ |else → $VISUAL/output/image-outfit-swap/;mkdir -p {output_dir}
Execute

触发信号 / 路由规则

场景判定条件路由
换装 / 换衣服换装、换衣服、试穿、穿上、改成 xxx 服装换装主路径 → 轻量路径 → 兜底路径
虚拟试穿(有服装图)用户上传了 clothes_image_url换装主路径(人物图与服装图共同输入)
简单颜色修改(衣服)把裙子改成红色换装主路径

参数定义

参数类型必填说明
image_urlSTRING是人物图片地址。缺失 → 提示"请提供需要换装的人物图片"
promptSTRING是目标服装描述。缺失 → 提示"请描述目标服装款式"
clothes_image_urlSTRING否服装参考图地址。提供时与 image_url 一起传入换装主路径

API 映射说明:

  • 换装主路径:prompt 自动扩写为英文换装指令(如 "Change the person's outfit to a white linen shirt, keep face and body unchanged")。
  • 降级与兜底路径:prompt 直传。

工具调用

meitu image-outfit-swap --image_url <person> --prompt "<target outfit>" --json --download-dir {output_dir} --skill_name skill_image-outfit-swap
# 带服装参考图
meitu image-outfit-swap --image_url <person> --clothes_image_url <clothes> --prompt "<target outfit>" --json --download-dir {output_dir} --skill_name skill_image-outfit-swap

错误降级

场景处理方式
image_url 缺失提示"请提供需要换装的人物图片",不调用 API
image_url 不可访问直接返回图片链接无效错误,不重试
prompt 缺失提示"请描述目标服装款式"
prompt 过于模糊提示细化描述(款式 / 颜色 / 材质 / 风格)
图片无明显人物返回错误,提示需包含清晰人物
换装主路径调用失败自动降级至轻量路径
换装轻量路径调用失败自动降级至兜底路径
换装兜底路径调用失败返回错误
内容合规拦截直接返回合规提示,不重试、不降级
Deliver
  • 使用 Preflight 解析的 output_dir
  • 从 downloaded_files[0].saved_path 读取已下载文件路径
  • mv {downloaded_files[0].saved_path} {output_dir}/{YYYY-MM-DD}_{descriptive}_image-outfit-swap.{ext}

Output

  • 格式:image(PNG/JPG 由 API 决定)
  • 位置:项目 → ./output/,一次性 → $VISUAL/output/image-outfit-swap/

基线 Task ID

见 references/task-id-baseline.md 中对应行。

Comments

Markdown supported