Overview
One-click image super-resolution: increase resolution, enhance clarity, denoise and remove compression artifacts. Call meitu image-superres-enhance, and let the CLI automatically choose the optimal upscaling path via the content description.
Dependencies
- meitu-cli ≥ 2.0.6 —
npm install -g meitu-cli@latest - Credential configuration: prefer the 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: below,
$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-upscale/mkdir -p {output_dir}
Execute
Input acquisition
The user provides an image, accepting the following forms:
- Local file path → use
--image_url <url_or_path> - Image URL → use
--image_url <url_or_path> - Image sent directly in the conversation → save to a temporary file then use
--image_url <url_or_path>
If the user does not provide an image, proactively ask: "Please provide the image to be upscaled (file path or URL)."
Content description selection
Construct the --promptbased on the image's main subject content, so that image-superres-enhance selects the appropriate upscaling path:
| Subject type | --prompt Example |
Basis for judgment |
|---|---|---|
| Portrait-dominant | portrait photo |
The face is the visual focus (ID photo, selfie, character close-up) |
| Product/object | e-commerce product image |
Products, food, physical object close-ups, commercial photography |
| Graphic/screenshot | text document or UI screenshot |
UI screenshots, text images, illustrations, icons, design drafts |
| Uncertain | general image |
Default description when it cannot be clearly categorized |
Selection strategy:
- The user explicitly stated the subject type → select the corresponding description per the table above
- The user did not specify → use the Read tool to read the image and visually determine the subject type
- Cannot determine (e.g., URL cannot be previewed) → use
general image
Invocation command
meitu image-superres-enhance \
--skill_name skill_meitu-upscale \
--image_url <url_or_path> \
--prompt "<content_description>" \
--json \
--download-dir {output_dir}
Note: this command is oriented toward clarity improvement and target resolution enhancement, and does not support the legacy
model_type. If the user emphasizes proportional geometric magnification of 2x/4x/8x, switch toimage-transform。
Result handling
ok: true→downloaded_files[0].saved_pathto obtain the local file path, and proceed to Deliverok: false→ proceed to error fallback
Error fallback
| Level | Strategy | Action |
|---|---|---|
| L1 | Simplify the content description | text document or UI screenshot / e-commerce product image When specialized descriptions such as fail, fall back to general image |
| L2 | Check image format/content | Confirm it is JPG/PNG/WEBP, not an unsupported format such as GIF/BMP/SVG.INVALID_RESOURCES (10025) may also be a content moderation rejection → tell the user "The image failed content moderation, please replace the image" |
| L3 | Check image source | URL unreachable → download to /tmp/meitu-upscale-input.{ext} then retry with the local path |
| L4 | Credential/balance issue | ORDER_REQUIRED → prompt to top up, display action_url |
| L5 | Stop reporting errors | 2 consecutive failures → report code + hint, stop retrying |
Clean up temporary files after completion:rm -f /tmp/meitu-upscale-input.*
Deliver
Directly use the output_dir parsed by Preflight.
mv {path} {output_dir}/{date}_upscale.{ext}
Extension:
{ext}taken from the actual extension ofdownloaded_files[0].saved_path(the server may return.jpeginstead of.jpg), uniformly converted to.jpg(i.e..jpeg→.jpg)。
Naming example:2026-03-23_upscale.jpg、2026-03-23_upscale_portrait.png
Output
| Project | Spec |
|---|---|
| Format | Consistent with the original image (JPG→JPG, PNG→PNG, WEBP→WEBP) |
| Quantity | Single image |
| Naming | {date}_upscale[_{context}].{ext} |
| Location | Parsed by the Deliver step |
Boundaries
This skill only doessuper-resolution—improve resolution and clarity without changing the image content.
| Does not do | Hand off to |
|---|---|
| Beauty smoothing | meitu-beauty |
| Watermark removal/passerby removal/content repair | meitu-image-fix |
| Style transfer | image-style-transfer(or via meitu-tools direct call) |
| Background removal | meitu-cutout |
| Comprehensive retouching (blur + watermark + beauty) | meitu-image-fix(will automatically call upscale in the pipeline) |