Overview
One-click AI portrait retouching: skin smoothing, whitening, facial detail optimization. Based on meitu image-edit --model gummy_pro for realistic portrait retouching, only supports single-person portrait photos.
Before execution, the user should be clearly informed that: this Skill will read Meitu credentials, call the local meitu CLI, send the user-provided portrait image and generation prompt to the Meitu OpenAPI for processing, and write the result to ./output/ or $VISUAL/output/meitu-beauty/. Portrait photos are sensitive personal appearance data, and it is necessary to confirm that the user has authorization to use and process the photos being handled.
Dependencies
- meitu-cli ≥ 2.0.6 —
npm install -g meitu-cli@latest - Credential configuration: prefer environment variable
MEITU_OPENAPI_ACCESS_KEY/MEITU_OPENAPI_SECRET_KEY, or preset~/.meitu/credentials.json; only when the user explicitly requests writing local credentials, then executemeitu config set-ak --value "..."+meitu config set-sk --value "..."
Path alias: In the following,
$VISUAL={OPENCLAW_HOME}/workspace/visual/
Core Workflow
Preflight → [Context: 跳过(工具型美颜,无创意自由度)] → Execute → Deliver
Preflight
meitu --version→ if not installed, promptnpm install -g meitu-cli@latestmeitu auth verify --json→ if credentials are invalid, guide configuration- Detect mode: cwd has
openclaw.yaml→ project mode; else → one-off Check$VISUALdirectory → determine capabilities - output_dir resolution (MUST be completed within Preflight):
Resolve output_dir: openclaw.yaml →
./output/| else →$VISUAL/output/meitu-beauty/mkdir -p {output_dir}
Execute
Input acquisition
The user provides an image, accepting the following forms:
- Local file path → use
--image_list <path> - Image URL → use
--image_list <url> - Image sent directly in the conversation → save to a temporary file and then use
--image_list <path>
If the user does not provide an image, proactively ask: "Please provide the portrait photo to be beautified (file path or URL)."
Portrait validation (key prerequisite step)
This tool only supports single-person portraits. Before calling, MUST validate:
-
Read the image provided by the user and visually inspect:
- Whether it contains a face → if no face, reject: "No portrait was detected in this image; the beauty tool only supports photos containing a face."
- Whether it is a single person → if multiple people, reject: "Multiple people detected; the beauty tool only supports single-person photos. Please crop to a single person and try again."
- Whether the face is large enough and clear → if the face is too small/blurry, warn: "The face is relatively small/blurry, and the beauty effect may not be obvious. Continue?"
-
If it cannot be predicted in advance (e.g., a URL cannot be previewed), call the tool directly and handle it based on the returned error.
Intensity selection
| User intent | prompt appended statement | Description |
|---|---|---|
| "natural beauty enhancement", "slight adjustment", "slightly beautify", intensity not specified | natural portrait retouch, keep facial structure unchanged |
Natural effect (default) |
| "strong beauty enhancement", "heavy skin smoothing", "make the effect stronger", "beautify aggressively" | strong but realistic skin smoothing, brighter complexion, keep facial structure unchanged |
Enhanced effect |
Call command
meitu image-edit \
--skill_name skill_meitu-beauty \
--image_list <url_or_path> \
--prompt "<beauty_instruction>" \
--model gummy_pro \
--json \
--download-dir {output_dir}
Note:
2.0.6no longer hasimage-beauty-enhance. Portrait beauty enhancement, skin quality optimization, and detail retouching are all completed uniformly throughimage-edit --model gummy_pro.
Result handling
ok: true→--download-dirIf specified, fromdownloaded_files[0].saved_pathobtain the local file path; if--download-dirwas not used, frommedia_urls[0]obtain the result image URLok: false→ enter error fallback
Error fallback
First check the CLI raw error field code、hint、error_name、action_url, then according to meitu-tools rules, classify as error_type and then route:
| error_type (classified from CLI raw field) | Handling | Retryable |
|---|---|---|
CONTENT_REQUIREMENTS_UNMET(or CLI raw error code=98501 / error_name=CONTENT_REQUIREMENTS_UNMET) |
The image does not contain a face or does not meet the single-person requirement. Directly inform the user: "This image does not meet the beauty retouching requirements (a single-person portrait photo is required), please replace the image." Do not retry. | No |
ORDER_REQUIRED |
Insufficient balance, prompt to top up, display action_url |
No |
CREDENTIALS_MISSING |
Prompt to configure AK/SK | No |
| Other errors | Degrade according to the following levels ↓ | Depends on the situation |
General degradation (only for retryable: true or unknown errors):
| Level | Strategy | Action |
|---|---|---|
| L1 | Reduce intensity | Converge the strong retouching prompt to natural portrait retouch, keep facial structure unchanged then retry |
| L2 | Check image quality | Prompt the user to replace with a clearer photo with a larger face |
| L3 | Check image format | Confirm it is JPG/PNG/WEBP, not unsupported formats such as GIF/BMP |
| L4 | Stop and report error | 2 consecutive failures → report code + hint, stop retrying |
Deliver
Directly use the output_dir parsed by Preflight.
mv {file} {output_dir}/{date}_beauty_{original_name}.{ext}
Naming example:2026-03-23_beauty_portrait.jpg
Output
| Item | Specification |
|---|---|
| Format | Same as the original image (usually JPG) |
| Quantity | Single image |
| Naming | {date}_beauty_{original_name}.{ext} |
| Location | Parsed by the Deliver step |