# Image Superres Enhance

> 图片清晰度提升/超分放大，按内容类型自动选算法（通用/电商商品图/文字文档）。当用户提到变清晰、超清、高清修复、画质提升、超分、放大到 4K/2K/1080P、老照片修复、商品图超清、文档超清、扫描件变清晰时触发。

- **Type:** Skill
- **Install:** `agentstack add skill-meitu-meitu-skills-image-superres-enhance`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [meitu](https://agentstack.voostack.com/s/meitu)
- **Installs:** 0
- **Category:** [Content & Media](https://agentstack.voostack.com/c/content-and-media)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [meitu](https://github.com/meitu)
- **Source:** https://github.com/meitu/meitu-skills/tree/main/skills/image-superres-enhance

## Install

```sh
agentstack add skill-meitu-meitu-skills-image-superres-enhance
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Image Superres Enhance

## Overview

对已有图片做清晰度提升 / 超分放大，按内容类型自动选最优算法，覆盖通用超分、电商商品图超分、文字文档超分。关键区分："放大到 4K/2K/1080P"（分辨率目标）走本工具；"放大 2/4/8 倍"（倍数放大）走 image-transform。

## API Mapping

- 通用超分：`api_v2_image_restoration_async`
- 电商商品图超分：`api_v1_dlbeautygoodsimagesr_async`
- 文字文档/扫描件超分：`api_v1_dlbeautytextimagesr_async`

## 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-superres-enhance/`；`mkdir -p`

### Execute

**触发信号 / 路由规则**

核心维度：**Agent 画面识别的内容类型**（prompt 信号词）。

| 场景 | 判定关键词 | 路由 |
|------|----------|------|
| 电商商品图 | 商品、产品、SKU、电商、白底商品 | `api_v1_dlbeautygoodsimagesr_async` |
| 文字文档 | 文档、文字、图表、扫描件、发票、合同、表格 | `api_v1_dlbeautytextimagesr_async` |
| 通用 / 未指定 | 人像、风景、老照片、其他 | `api_v2_image_restoration_async` |
| 混合内容 | -- | 默认走通用或询问 |
| 商品图 + 指定分辨率 | 商品图变 4K | `api_v1_dlbeautygoodsimagesr_async`（场景专用优于通用） |

路由原则：**场景专用优于通用**；Agent 调用前先识别图片内容生成 `prompt`，无法判断则 `prompt` 写"通用图片"走默认。

**参数定义**

| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| `image_url` | STRING | 是 | 图片地址。缺失 → 提示"请提供需要超清处理的图片" |
| `prompt` | STRING | 是 | Agent 对图片内容的描述，用于内部路由判断（如"电商白底商品图""扫描件文字文档""风景照片"） |

所有 API 仅使用 `image_url + prompt`，无额外参数。

**工具调用**

```bash
meitu image-superres-enhance --image_url  --prompt "" --json --download-dir {output_dir} --skill_name skill_image-superres-enhance
```

**错误降级**

| 场景 | 处理方式 |
|------|------|
| `image_url` 缺失 | 提示"请提供需要超清处理的图片" |
| `image_url` 不可访问 | 直接返回图片链接无效错误，不重试 |
| `prompt` 为空或无信号词 | 默认走 `api_v2_image_restoration_async` |
| 混合内容（文字 + 商品） | 询问或默认走通用 |
| 任一 API 调用失败 | 切换 `api_v2_image_restoration_async` 重试 1 次 → 仍失败返回错误 |
| 内容合规拦截 | 直接返回合规提示，不重试、不降级 |
| 商品图 + 指定分辨率 | 优先走商品超分（场景专用优先），分辨率由 API 内部处理 |

### Deliver

- 使用 Preflight 解析的 output_dir
- 从 `downloaded_files[0].saved_path` 读取已下载文件路径
- `mv {downloaded_files[0].saved_path} {output_dir}/{YYYY-MM-DD}_{descriptive}_image-superres-enhance.{ext}`

## Output

- **格式**：image
- **位置**：项目 → `./output/`，一次性 → `$VISUAL/output/image-superres-enhance/`

## 基线 Task ID

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

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [meitu](https://github.com/meitu)
- **Source:** [meitu/meitu-skills](https://github.com/meitu/meitu-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-meitu-meitu-skills-image-superres-enhance
- Seller: https://agentstack.voostack.com/s/meitu
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
