Overview
Perform AI outfit change on an existing person image, keeping the person's face / body shape / appearance and only replacing the clothing, supporting a text description of the target clothing or uploading a clothing reference image (the person image + clothing image are passed in via image_list). Simple color changes (such as "change the skirt to red") also belong to this tool.
Before execution, the user should clearly know: this Skill will read Meitu credentials, call the local meitu CLI, send the user-provided person image, optional clothing reference image, and outfit change description to the Meitu OpenAPI for processing, and write the result to ./output/ or $VISUAL/output/image-outfit-swap/. When portrait photos are involved, confirm that you are authorized to process the people in the photos.
API Mapping
- The main outfit change path, lightweight fallback, and final fallback path are handled internally by the
image-outfit-swaprouter.
Dependencies
- meitu-cli:
>=2.0.6 - Credentials:CONFIG AKSK →
meitu tools update; EXEC AKSK → actual execution (see rootCONFIG.md) - Environment variables:
MEITU_OPENAPI_TOOL_TASK_MODE=command
Path alias:
$VISUAL={OPENCLAW_HOME}/workspace/visual/
Core Workflow
Preflight → Execute → Deliver
Preflight
meitu --version≥ 2.0.6- Already ran with CONFIG AKSK
meitu tools update - Current AKSK = EXEC,
MEITU_OPENAPI_TOOL_TASK_MODE=command - output_dir:openclaw.yaml →
./output/|else →$VISUAL/output/image-outfit-swap/;mkdir -p {output_dir}
Execute
Trigger signals / routing rules
| Scenario | Judgment condition | Route |
|---|---|---|
| Outfit change / changing clothes | Outfit change, changing clothes, try-on, put on, change to xxx clothing | Main outfit change path → lightweight path → final fallback path |
| Virtual try-on (with clothing image) | The user uploaded clothes_image_url | Main outfit change path (person image and clothing image input together) |
| Simple color change (clothing) | Change the skirt to red | Main outfit change path |
Parameter definitions
| Parameter | Type | Required | Description |
|---|---|---|---|
image_url |
STRING | Yes | Person image URL. If missing → prompt "Please provide the person image that needs an outfit change" |
prompt |
STRING | Yes | Target clothing description. If missing → prompt "Please describe the target clothing style" |
clothes_image_url |
STRING | No | Clothing reference image URL. When provided, it is passed into the main outfit change path together with image_url |
API mapping description:
- Main outfit change path:
promptautomatically expands into an English outfit change instruction (such as"Change the person's outfit to a white linen shirt, keep face and body unchanged")。 - Fallback and final fallback paths:
promptpasses through directly.
Tool invocation
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
Error fallback
| Scenario | Handling method |
|---|---|
image_url missing |
Prompt "Please provide the person image that needs an outfit change" and do not call the API |
image_url inaccessible |
Directly return an invalid image link error and do not retry |
prompt missing |
Prompt "Please describe the target clothing style" |
prompt too vague |
Prompt for a more detailed description (style / color / material / style) |
| No obvious person in the image | Return an error and prompt that it must contain a clear person |
| Main outfit change path call failed | Automatically fall back to the lightweight path |
| Lightweight outfit change path call failed | Automatically degrade to fallback path |
| Fallback path invocation failed | Return error |
| Content compliance interception | Directly return compliance prompt, no retry, no degradation |
Deliver
- Use the output_dir parsed by Preflight
- From
downloaded_files[0].saved_pathread the downloaded file path mv {downloaded_files[0].saved_path} {output_dir}/{YYYY-MM-DD}_{descriptive}_image-outfit-swap.{ext}
Output
- Format: image (PNG/JPG determined by API)
- Location: project →
./output/, one-time →$VISUAL/output/image-outfit-swap/
Baseline Task ID
See references/task-id-baseline.md corresponding row in .